Core/DataStores: Updated db2 structures to 8.2.5

Port From (https://github.com/TrinityCore/TrinityCore/commit/3ac790287aba5f7d7c3bccf79e608de9119e461a)
This commit is contained in:
hondacrx
2019-10-29 13:09:23 -04:00
parent c6e53b2ba7
commit e95115dc94
54 changed files with 4589 additions and 349 deletions
@@ -417,7 +417,7 @@ namespace Framework.Constants
ReachAccountHonorLevel = 213, ReachAccountHonorLevel = 213,
HeartOfAzerothArtifactPowerEarned = 214, HeartOfAzerothArtifactPowerEarned = 214,
HeartOfAzerothLevelReached = 215, HeartOfAzerothLevelReached = 215,
TotalTypes = 217 TotalTypes = 219
} }
public enum CriteriaDataType public enum CriteriaDataType
+4 -2
View File
@@ -304,7 +304,7 @@ namespace Framework.Constants
BattlePetDisplayId = 6, BattlePetDisplayId = 6,
EnchantIllusionAllSpecs = 7, EnchantIllusionAllSpecs = 7,
ArtifactAppearanceId = 8, ArtifactAppearanceId = 8,
ScalingStatDistributionFixedLevel = 9, TimewalkerLevel = 9,
EnchantIllusionSpec1 = 10, EnchantIllusionSpec1 = 10,
TransmogAppearanceSpec2 = 11, TransmogAppearanceSpec2 = 11,
EnchantIllusionSpec2 = 12, EnchantIllusionSpec2 = 12,
@@ -317,9 +317,11 @@ namespace Framework.Constants
ChallengeKeystoneAffixId1 = 19, ChallengeKeystoneAffixId1 = 19,
ChallengeKeystoneAffixId2 = 20, ChallengeKeystoneAffixId2 = 20,
ChallengeKeystoneAffixId3 = 21, ChallengeKeystoneAffixId3 = 21,
ChallengeKeystoneIsCharged = 22, ChallengeKeystoneAffixId4 = 22,
ArtifactKnowledgeLevel = 23, ArtifactKnowledgeLevel = 23,
ArtifactTier = 24, ArtifactTier = 24,
Unused25 = 25,
PvpRating = 26,
Max Max
} }
@@ -757,6 +757,7 @@ namespace Framework.Constants
PvpIsland = 45, PvpIsland = 45,
NormalWarfront = 147, NormalWarfront = 147,
HeroicWarfront = 149, HeroicWarfront = 149,
LFR15thAnniversary = 151,
Max Max
} }
@@ -22,7 +22,7 @@ namespace Framework.Database
public override void PreparedStatements() public override void PreparedStatements()
{ {
const string SelectItemInstanceContent = "ii.guid, ii.itemEntry, ii.creatorGuid, ii.giftCreatorGuid, ii.count, ii.duration, ii.charges, ii.flags, ii.enchantments, ii.randomBonusListId, " + const string SelectItemInstanceContent = "ii.guid, ii.itemEntry, ii.creatorGuid, ii.giftCreatorGuid, ii.count, ii.duration, ii.charges, ii.flags, ii.enchantments, ii.randomBonusListId, " +
"ii.durability, ii.playedTime, ii.text, ii.upgradeId, ii.battlePetSpeciesId, ii.battlePetBreedData, ii.battlePetLevel, ii.battlePetDisplayId, ii.context, ii.bonusListIDs, " + "ii.durability, ii.playedTime, ii.text, ii.battlePetSpeciesId, ii.battlePetBreedData, ii.battlePetLevel, ii.battlePetDisplayId, ii.context, ii.bonusListIDs, " +
"iit.itemModifiedAppearanceAllSpecs, iit.itemModifiedAppearanceSpec1, iit.itemModifiedAppearanceSpec2, iit.itemModifiedAppearanceSpec3, iit.itemModifiedAppearanceSpec4, " + "iit.itemModifiedAppearanceAllSpecs, iit.itemModifiedAppearanceSpec1, iit.itemModifiedAppearanceSpec2, iit.itemModifiedAppearanceSpec3, iit.itemModifiedAppearanceSpec4, " +
"iit.spellItemEnchantmentAllSpecs, iit.spellItemEnchantmentSpec1, iit.spellItemEnchantmentSpec2, iit.spellItemEnchantmentSpec3, iit.spellItemEnchantmentSpec4, " + "iit.spellItemEnchantmentAllSpecs, iit.spellItemEnchantmentSpec1, iit.spellItemEnchantmentSpec2, iit.spellItemEnchantmentSpec3, iit.spellItemEnchantmentSpec4, " +
"ig.gemItemId1, ig.gemBonuses1, ig.gemContext1, ig.gemScalingLevel1, ig.gemItemId2, ig.gemBonuses2, ig.gemContext2, ig.gemScalingLevel2, ig.gemItemId3, ig.gemBonuses3, ig.gemContext3, ig.gemScalingLevel3, " + "ig.gemItemId1, ig.gemBonuses1, ig.gemContext1, ig.gemScalingLevel1, ig.gemItemId2, ig.gemBonuses2, ig.gemContext2, ig.gemScalingLevel2, ig.gemItemId3, ig.gemBonuses3, ig.gemContext3, ig.gemScalingLevel3, " +
@@ -165,9 +165,9 @@ namespace Framework.Database
PrepareStatement(CharStatements.DEL_ITEM_BOP_TRADE, "DELETE FROM item_soulbound_trade_data WHERE itemGuid = ? LIMIT 1"); PrepareStatement(CharStatements.DEL_ITEM_BOP_TRADE, "DELETE FROM item_soulbound_trade_data WHERE itemGuid = ? LIMIT 1");
PrepareStatement(CharStatements.INS_ITEM_BOP_TRADE, "INSERT INTO item_soulbound_trade_data VALUES (?, ?)"); PrepareStatement(CharStatements.INS_ITEM_BOP_TRADE, "INSERT INTO item_soulbound_trade_data VALUES (?, ?)");
PrepareStatement(CharStatements.REP_INVENTORY_ITEM, "REPLACE INTO character_inventory (guid, bag, slot, item) VALUES (?, ?, ?, ?)"); PrepareStatement(CharStatements.REP_INVENTORY_ITEM, "REPLACE INTO character_inventory (guid, bag, slot, item) VALUES (?, ?, ?, ?)");
PrepareStatement(CharStatements.REP_ITEM_INSTANCE, "REPLACE INTO item_instance (itemEntry, owner_guid, creatorGuid, giftCreatorGuid, count, duration, charges, flags, enchantments, randomBonusListId, durability, playedTime, text, upgradeId, battlePetSpeciesId, battlePetBreedData, battlePetLevel, battlePetDisplayId, context, bonusListIDs, guid) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"); PrepareStatement(CharStatements.REP_ITEM_INSTANCE, "REPLACE INTO item_instance (itemEntry, owner_guid, creatorGuid, giftCreatorGuid, count, duration, charges, flags, enchantments, randomBonusListId, durability, playedTime, text, battlePetSpeciesId, battlePetBreedData, battlePetLevel, battlePetDisplayId, context, bonusListIDs, guid) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)");
PrepareStatement(CharStatements.UPD_ITEM_INSTANCE, "UPDATE item_instance SET itemEntry = ?, owner_guid = ?, creatorGuid = ?, giftCreatorGuid = ?, count = ?, duration = ?, charges = ?, flags = ?, enchantments = ?, randomBonusListId = ?, durability = ?, playedTime = ?, text = ?, upgradeId = ?, battlePetSpeciesId = ?, battlePetBreedData = ?, battlePetLevel = ?, battlePetDisplayId = ?, context = ?, bonusListIDs = ? WHERE guid = ?"); PrepareStatement(CharStatements.UPD_ITEM_INSTANCE, "UPDATE item_instance SET itemEntry = ?, owner_guid = ?, creatorGuid = ?, giftCreatorGuid = ?, count = ?, duration = ?, charges = ?, flags = ?, enchantments = ?, randomBonusListId = ?, durability = ?, playedTime = ?, text = ?, battlePetSpeciesId = ?, battlePetBreedData = ?, battlePetLevel = ?, battlePetDisplayId = ?, context = ?, bonusListIDs = ? WHERE guid = ?");
PrepareStatement(CharStatements.UPD_ITEM_INSTANCE_ON_LOAD, "UPDATE item_instance SET duration = ?, flags = ?, durability = ?, upgradeId = ? WHERE guid = ?"); PrepareStatement(CharStatements.UPD_ITEM_INSTANCE_ON_LOAD, "UPDATE item_instance SET duration = ?, flags = ?, durability = ? WHERE guid = ?");
PrepareStatement(CharStatements.DEL_ITEM_INSTANCE, "DELETE FROM item_instance WHERE guid = ?"); PrepareStatement(CharStatements.DEL_ITEM_INSTANCE, "DELETE FROM item_instance WHERE guid = ?");
PrepareStatement(CharStatements.DEL_ITEM_INSTANCE_BY_OWNER, "DELETE FROM item_instance WHERE owner_guid = ?"); PrepareStatement(CharStatements.DEL_ITEM_INSTANCE_BY_OWNER, "DELETE FROM item_instance WHERE owner_guid = ?");
PrepareStatement(CharStatements.INS_ITEM_INSTANCE_GEMS, "INSERT INTO item_instance_gems (itemGuid, gemItemId1, gemBonuses1, gemContext1, gemScalingLevel1, gemItemId2, gemBonuses2, gemContext2, gemScalingLevel2, gemItemId3, gemBonuses3, gemContext3, gemScalingLevel3) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"); PrepareStatement(CharStatements.INS_ITEM_INSTANCE_GEMS, "INSERT INTO item_instance_gems (itemGuid, gemItemId1, gemBonuses1, gemContext1, gemScalingLevel1, gemItemId2, gemBonuses2, gemContext2, gemScalingLevel2, gemItemId3, gemBonuses3, gemContext3, gemScalingLevel3) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)");
@@ -619,8 +619,8 @@ namespace Framework.Database
PrepareStatement(CharStatements.DEL_CHAR_FISHINGSTEPS, "DELETE FROM character_fishingsteps WHERE guid = ?"); PrepareStatement(CharStatements.DEL_CHAR_FISHINGSTEPS, "DELETE FROM character_fishingsteps WHERE guid = ?");
// Void Storage // Void Storage
PrepareStatement(CharStatements.SEL_CHAR_VOID_STORAGE, "SELECT itemId, itemEntry, slot, creatorGuid, randomBonusListId, upgradeId, fixedScalingLevel, artifactKnowledgeLevel, context, bonusListIDs FROM character_void_storage WHERE playerGuid = ?"); PrepareStatement(CharStatements.SEL_CHAR_VOID_STORAGE, "SELECT itemId, itemEntry, slot, creatorGuid, randomBonusListId, fixedScalingLevel, artifactKnowledgeLevel, context, bonusListIDs FROM character_void_storage WHERE playerGuid = ?");
PrepareStatement(CharStatements.REP_CHAR_VOID_STORAGE_ITEM, "REPLACE INTO character_void_storage (itemId, playerGuid, itemEntry, slot, creatorGuid, randomBonusListId, upgradeId, fixedScalingLevel, artifactKnowledgeLevel, context, bonusListIDs) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"); PrepareStatement(CharStatements.REP_CHAR_VOID_STORAGE_ITEM, "REPLACE INTO character_void_storage (itemId, playerGuid, itemEntry, slot, creatorGuid, randomBonusListId, fixedScalingLevel, artifactKnowledgeLevel, context, bonusListIDs) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)");
PrepareStatement(CharStatements.DEL_CHAR_VOID_STORAGE_ITEM_BY_CHAR_GUID, "DELETE FROM character_void_storage WHERE playerGuid = ?"); PrepareStatement(CharStatements.DEL_CHAR_VOID_STORAGE_ITEM_BY_CHAR_GUID, "DELETE FROM character_void_storage WHERE playerGuid = ?");
PrepareStatement(CharStatements.DEL_CHAR_VOID_STORAGE_ITEM_BY_SLOT, "DELETE FROM character_void_storage WHERE slot = ? AND playerGuid = ?"); PrepareStatement(CharStatements.DEL_CHAR_VOID_STORAGE_ITEM_BY_SLOT, "DELETE FROM character_void_storage WHERE slot = ? AND playerGuid = ?");
@@ -447,8 +447,8 @@ namespace Framework.Database
"ItemGroupSoundsID FROM item ORDER BY ID DESC"); "ItemGroupSoundsID FROM item ORDER BY ID DESC");
// ItemAppearance.db2 // ItemAppearance.db2
PrepareStatement(HotfixStatements.SEL_ITEM_APPEARANCE, "SELECT ID, DisplayType, ItemDisplayInfoID, DefaultIconFileDataID, UiOrder FROM item_appearance" + PrepareStatement(HotfixStatements.SEL_ITEM_APPEARANCE, "SELECT ID, DisplayType, SubclassID, ItemDisplayInfoID, DefaultIconFileDataID, UiOrder" +
" ORDER BY ID DESC"); " FROM item_appearance ORDER BY ID DESC");
// ItemArmorQuality.db2 // ItemArmorQuality.db2
PrepareStatement(HotfixStatements.SEL_ITEM_ARMOR_QUALITY, "SELECT ID, Qualitymod1, Qualitymod2, Qualitymod3, Qualitymod4, Qualitymod5, Qualitymod6, " + PrepareStatement(HotfixStatements.SEL_ITEM_ARMOR_QUALITY, "SELECT ID, Qualitymod1, Qualitymod2, Qualitymod3, Qualitymod4, Qualitymod5, Qualitymod6, " +
@@ -569,10 +569,10 @@ namespace Framework.Database
"StatPercentageOfSocket9, StatPercentageOfSocket10, StatPercentEditor1, StatPercentEditor2, StatPercentEditor3, StatPercentEditor4, " + "StatPercentageOfSocket9, StatPercentageOfSocket10, StatPercentEditor1, StatPercentEditor2, StatPercentEditor3, StatPercentEditor4, " +
"StatPercentEditor5, StatPercentEditor6, StatPercentEditor7, StatPercentEditor8, StatPercentEditor9, StatPercentEditor10, Stackable, " + "StatPercentEditor5, StatPercentEditor6, StatPercentEditor7, StatPercentEditor8, StatPercentEditor9, StatPercentEditor10, Stackable, " +
"MaxCount, RequiredAbility, SellPrice, BuyPrice, VendorStackCount, PriceVariance, PriceRandomValue, Flags1, Flags2, Flags3, Flags4, " + "MaxCount, RequiredAbility, SellPrice, BuyPrice, VendorStackCount, PriceVariance, PriceRandomValue, Flags1, Flags2, Flags3, Flags4, " +
"FactionRelated, ItemNameDescriptionID, RequiredTransmogHoliday, RequiredHoliday, LimitCategory, GemProperties, SocketMatchEnchantmentId, " + "FactionRelated, ItemNameDescriptionID, RequiredTransmogHoliday, RequiredHoliday, LimitCategory, GemProperties, SocketMatchEnchantmentId, " +
"TotemCategoryID, InstanceBound, ZoneBound, ItemSet, LockID, StartQuestID, PageID, ItemDelay, ScalingStatDistributionID, MinFactionID, " + "TotemCategoryID, InstanceBound, ZoneBound1, ZoneBound2, ItemSet, LockID, StartQuestID, PageID, ItemDelay, ScalingStatDistributionID, " +
"RequiredSkillRank, RequiredSkill, ItemLevel, AllowableClass, ExpansionID, ArtifactID, SpellWeight, SpellWeightCategory, SocketType1, " + "MinFactionID, RequiredSkillRank, RequiredSkill, ItemLevel, AllowableClass, ExpansionID, ArtifactID, SpellWeight, SpellWeightCategory, " +
"SocketType2, SocketType3, SheatheType, Material, PageMaterialID, LanguageID, Bonding, DamageDamageType, StatModifierBonusStat1, " + "SocketType1, SocketType2, SocketType3, SheatheType, Material, PageMaterialID, LanguageID, Bonding, DamageDamageType, StatModifierBonusStat1, " +
"StatModifierBonusStat2, StatModifierBonusStat3, StatModifierBonusStat4, StatModifierBonusStat5, StatModifierBonusStat6, " + "StatModifierBonusStat2, StatModifierBonusStat3, StatModifierBonusStat4, StatModifierBonusStat5, StatModifierBonusStat6, " +
"StatModifierBonusStat7, StatModifierBonusStat8, StatModifierBonusStat9, StatModifierBonusStat10, ContainerSlots, MinReputation, " + "StatModifierBonusStat7, StatModifierBonusStat8, StatModifierBonusStat9, StatModifierBonusStat10, ContainerSlots, MinReputation, " +
"RequiredPVPMedal, RequiredPVPRank, RequiredLevel, InventoryType, OverallQualityID FROM item_sparse ORDER BY ID DESC"); "RequiredPVPMedal, RequiredPVPRank, RequiredLevel, InventoryType, OverallQualityID FROM item_sparse ORDER BY ID DESC");
@@ -586,10 +586,6 @@ namespace Framework.Database
// ItemSpecOverride.db2 // ItemSpecOverride.db2
PrepareStatement(HotfixStatements.SEL_ITEM_SPEC_OVERRIDE, "SELECT ID, SpecID, ItemID FROM item_spec_override ORDER BY ID DESC"); PrepareStatement(HotfixStatements.SEL_ITEM_SPEC_OVERRIDE, "SELECT ID, SpecID, ItemID FROM item_spec_override ORDER BY ID DESC");
// ItemUpgrade.db2
PrepareStatement(HotfixStatements.SEL_ITEM_UPGRADE, "SELECT ID, ItemUpgradePathID, ItemLevelIncrement, PrerequisiteID, CurrencyType, CurrencyAmount" +
" FROM item_upgrade ORDER BY ID DESC");
// ItemXBonusTree.db2 // ItemXBonusTree.db2
PrepareStatement(HotfixStatements.SEL_ITEM_X_BONUS_TREE, "SELECT ID, ItemBonusTreeID, ItemID FROM item_x_bonus_tree ORDER BY ID DESC"); PrepareStatement(HotfixStatements.SEL_ITEM_X_BONUS_TREE, "SELECT ID, ItemBonusTreeID, ItemID FROM item_x_bonus_tree ORDER BY ID DESC");
@@ -712,7 +708,7 @@ namespace Framework.Database
PrepareStatement(HotfixStatements.SEL_POWER_DISPLAY, "SELECT ID, GlobalStringBaseTag, ActualType, Red, Green, Blue FROM power_display ORDER BY ID DESC"); PrepareStatement(HotfixStatements.SEL_POWER_DISPLAY, "SELECT ID, GlobalStringBaseTag, ActualType, Red, Green, Blue FROM power_display ORDER BY ID DESC");
// PowerType.db2 // PowerType.db2
PrepareStatement(HotfixStatements.SEL_POWER_TYPE, "SELECT ID, NameGlobalStringTag, CostGlobalStringTag, PowerTypeEnum, MinPower, MaxBasePower, CenterPower, " + PrepareStatement(HotfixStatements.SEL_POWER_TYPE, "SELECT NameGlobalStringTag, CostGlobalStringTag, ID, PowerTypeEnum, MinPower, MaxBasePower, CenterPower, " +
"DefaultPower, DisplayModifier, RegenInterruptTimeMS, RegenPeace, RegenCombat, Flags FROM power_type ORDER BY ID DESC"); "DefaultPower, DisplayModifier, RegenInterruptTimeMS, RegenPeace, RegenCombat, Flags FROM power_type ORDER BY ID DESC");
// PrestigeLevelInfo.db2 // PrestigeLevelInfo.db2
@@ -775,9 +771,6 @@ namespace Framework.Database
// RewardPackXItem.db2 // RewardPackXItem.db2
PrepareStatement(HotfixStatements.SEL_REWARD_PACK_X_ITEM, "SELECT ID, ItemID, ItemQuantity, RewardPackID FROM reward_pack_x_item ORDER BY ID DESC"); PrepareStatement(HotfixStatements.SEL_REWARD_PACK_X_ITEM, "SELECT ID, ItemID, ItemQuantity, RewardPackID FROM reward_pack_x_item ORDER BY ID DESC");
// RulesetItemUpgrade.db2
PrepareStatement(HotfixStatements.SEL_RULESET_ITEM_UPGRADE, "SELECT ID, ItemID, ItemUpgradeID FROM ruleset_item_upgrade ORDER BY ID DESC");
// ScalingStatDistribution.db2 // ScalingStatDistribution.db2
PrepareStatement(HotfixStatements.SEL_SCALING_STAT_DISTRIBUTION, "SELECT ID, PlayerLevelToItemLevelCurveID, MinLevel, MaxLevel" + PrepareStatement(HotfixStatements.SEL_SCALING_STAT_DISTRIBUTION, "SELECT ID, PlayerLevelToItemLevelCurveID, MinLevel, MaxLevel" +
" FROM scaling_stat_distribution ORDER BY ID DESC"); " FROM scaling_stat_distribution ORDER BY ID DESC");
@@ -865,7 +858,7 @@ namespace Framework.Database
PrepareStatement(HotfixStatements.SEL_SPELL_DURATION, "SELECT ID, Duration, DurationPerLevel, MaxDuration FROM spell_duration ORDER BY ID DESC"); PrepareStatement(HotfixStatements.SEL_SPELL_DURATION, "SELECT ID, Duration, DurationPerLevel, MaxDuration FROM spell_duration ORDER BY ID DESC");
// SpellEffect.db2 // SpellEffect.db2
PrepareStatement(HotfixStatements.SEL_SPELL_EFFECT, "SELECT ID, DifficultyID, EffectIndex, Effect, EffectAmplitude, EffectAttributes, EffectAura, " + PrepareStatement(HotfixStatements.SEL_SPELL_EFFECT, "SELECT ID, EffectAura, DifficultyID, EffectIndex, Effect, EffectAmplitude, EffectAttributes, " +
"EffectAuraPeriod, EffectBonusCoefficient, EffectChainAmplitude, EffectChainTargets, EffectItemType, EffectMechanic, EffectPointsPerResource, " + "EffectAuraPeriod, EffectBonusCoefficient, EffectChainAmplitude, EffectChainTargets, EffectItemType, EffectMechanic, EffectPointsPerResource, " +
"EffectPosFacing, EffectRealPointsPerLevel, EffectTriggerSpell, BonusCoefficientFromAP, PvpMultiplier, Coefficient, Variance, " + "EffectPosFacing, EffectRealPointsPerLevel, EffectTriggerSpell, BonusCoefficientFromAP, PvpMultiplier, Coefficient, Variance, " +
"ResourceCoefficient, GroupSizeBasePointsCoefficient, EffectBasePoints, EffectMiscValue1, EffectMiscValue2, EffectRadiusIndex1, " + "ResourceCoefficient, GroupSizeBasePointsCoefficient, EffectBasePoints, EffectMiscValue1, EffectMiscValue2, EffectRadiusIndex1, " +
@@ -905,9 +898,9 @@ namespace Framework.Database
" FROM spell_levels ORDER BY ID DESC"); " FROM spell_levels ORDER BY ID DESC");
// SpellMisc.db2 // SpellMisc.db2
PrepareStatement(HotfixStatements.SEL_SPELL_MISC, "SELECT ID, DifficultyID, CastingTimeIndex, DurationIndex, RangeIndex, SchoolMask, Speed, LaunchDelay, " + PrepareStatement(HotfixStatements.SEL_SPELL_MISC, "SELECT Attributes1, Attributes2, Attributes3, Attributes4, Attributes5, Attributes6, Attributes7, " +
"MinDuration, SpellIconFileDataID, ActiveIconFileDataID, ContentTuningID, Attributes1, Attributes2, Attributes3, Attributes4, Attributes5, " + "Attributes8, Attributes9, Attributes10, Attributes11, Attributes12, Attributes13, Attributes14, ID, DifficultyID, CastingTimeIndex, " +
"Attributes6, Attributes7, Attributes8, Attributes9, Attributes10, Attributes11, Attributes12, Attributes13, Attributes14, SpellID" + "DurationIndex, RangeIndex, SchoolMask, Speed, LaunchDelay, MinDuration, SpellIconFileDataID, ActiveIconFileDataID, ContentTuningID, SpellID" +
" FROM spell_misc ORDER BY ID DESC"); " FROM spell_misc ORDER BY ID DESC");
// SpellName.db2 // SpellName.db2
@@ -1009,8 +1002,8 @@ namespace Framework.Database
PrepareStatement(HotfixStatements.SEL_TRANSMOG_HOLIDAY, "SELECT ID, RequiredTransmogHoliday FROM transmog_holiday ORDER BY ID DESC"); PrepareStatement(HotfixStatements.SEL_TRANSMOG_HOLIDAY, "SELECT ID, RequiredTransmogHoliday FROM transmog_holiday ORDER BY ID DESC");
// TransmogSet.db2 // TransmogSet.db2
PrepareStatement(HotfixStatements.SEL_TRANSMOG_SET, "SELECT Name, ID, ClassMask, TrackingQuestID, Flags, TransmogSetGroupID, ItemNameDescriptionID, " + PrepareStatement(HotfixStatements.SEL_TRANSMOG_SET, "SELECT Name, ID, ClassMask, TrackingQuestID, Flags, TransmogSetGroupID, ItemNameDescriptionID, " +
"ParentTransmogSetID, Unknown810, ExpansionID, PatchID, UiOrder FROM transmog_set ORDER BY ID DESC"); "ParentTransmogSetID, Unknown810, ExpansionID, PatchID, UiOrder, PlayerConditionID FROM transmog_set ORDER BY ID DESC");
PrepareStatement(HotfixStatements.SEL_TRANSMOG_SET_LOCALE, "SELECT ID, Name_lang FROM transmog_set_locale WHERE locale = ?"); PrepareStatement(HotfixStatements.SEL_TRANSMOG_SET_LOCALE, "SELECT ID, Name_lang FROM transmog_set_locale WHERE locale = ?");
// TransmogSetGroup.db2 // TransmogSetGroup.db2
@@ -1081,10 +1074,6 @@ namespace Framework.Database
PrepareStatement(HotfixStatements.SEL_WORLD_MAP_OVERLAY, "SELECT ID, UiMapArtID, TextureWidth, TextureHeight, OffsetX, OffsetY, HitRectTop, HitRectBottom, " + PrepareStatement(HotfixStatements.SEL_WORLD_MAP_OVERLAY, "SELECT ID, UiMapArtID, TextureWidth, TextureHeight, OffsetX, OffsetY, HitRectTop, HitRectBottom, " +
"HitRectLeft, HitRectRight, PlayerConditionID, Flags, AreaID1, AreaID2, AreaID3, AreaID4 FROM world_map_overlay ORDER BY ID DESC"); "HitRectLeft, HitRectRight, PlayerConditionID, Flags, AreaID1, AreaID2, AreaID3, AreaID4 FROM world_map_overlay ORDER BY ID DESC");
// WorldSafeLocs.db2
PrepareStatement(HotfixStatements.SEL_WORLD_SAFE_LOCS, "SELECT ID, AreaName, LocX, LocY, LocZ, MapID, Facing FROM world_safe_locs ORDER BY ID DESC");
PrepareStatement(HotfixStatements.SEL_WORLD_SAFE_LOCS_LOCALE, "SELECT ID, AreaName_lang FROM world_safe_locs_locale WHERE locale = ?");
// WorldStateExpression.db2 // WorldStateExpression.db2
PrepareStatement(HotfixStatements.SEL_WORLD_STATE_EXPRESSION, "SELECT ID, Expression FROM world_state_expression ORDER BY ID DESC"); PrepareStatement(HotfixStatements.SEL_WORLD_STATE_EXPRESSION, "SELECT ID, Expression FROM world_state_expression ORDER BY ID DESC");
} }
@@ -1380,8 +1369,6 @@ namespace Framework.Database
SEL_ITEM_SPEC_OVERRIDE, SEL_ITEM_SPEC_OVERRIDE,
SEL_ITEM_UPGRADE,
SEL_ITEM_X_BONUS_TREE, SEL_ITEM_X_BONUS_TREE,
SEL_KEYCHAIN, SEL_KEYCHAIN,
@@ -1475,8 +1462,6 @@ namespace Framework.Database
SEL_REWARD_PACK_X_ITEM, SEL_REWARD_PACK_X_ITEM,
SEL_RULESET_ITEM_UPGRADE,
SEL_SCALING_STAT_DISTRIBUTION, SEL_SCALING_STAT_DISTRIBUTION,
SEL_SCENARIO, SEL_SCENARIO,
@@ -1634,9 +1619,6 @@ namespace Framework.Database
SEL_WORLD_MAP_OVERLAY, SEL_WORLD_MAP_OVERLAY,
SEL_WORLD_SAFE_LOCS,
SEL_WORLD_SAFE_LOCS_LOCALE,
SEL_WORLD_STATE_EXPRESSION, SEL_WORLD_STATE_EXPRESSION,
MAX_HOTFIXDATABASE_STATEMENTS MAX_HOTFIXDATABASE_STATEMENTS
+7 -7
View File
@@ -596,7 +596,7 @@ namespace Game.BattleFields
return null; return null;
} }
public WorldSafeLocsRecord GetClosestGraveYard(Player player) public WorldSafeLocsEntry GetClosestGraveYard(Player player)
{ {
BfGraveyard closestGY = null; BfGraveyard closestGY = null;
float maxdist = -1; float maxdist = -1;
@@ -617,7 +617,7 @@ namespace Game.BattleFields
} }
if (closestGY != null) if (closestGY != null)
return CliDB.WorldSafeLocsStorage.LookupByKey(closestGY.GetGraveyardId()); return Global.ObjectMgr.GetWorldSafeLoc(closestGY.GetGraveyardId());
return null; return null;
} }
@@ -891,8 +891,8 @@ namespace Game.BattleFields
public float GetDistance(Player player) public float GetDistance(Player player)
{ {
WorldSafeLocsRecord safeLoc = CliDB.WorldSafeLocsStorage.LookupByKey(m_GraveyardId); WorldSafeLocsEntry safeLoc = Global.ObjectMgr.GetWorldSafeLoc(m_GraveyardId);
return player.GetDistance2d(safeLoc.Loc.X, safeLoc.Loc.Y); return player.GetDistance2d(safeLoc.Loc.GetPositionX(), safeLoc.Loc.GetPositionY());
} }
public void AddPlayer(ObjectGuid playerGuid) public void AddPlayer(ObjectGuid playerGuid)
@@ -964,7 +964,7 @@ namespace Game.BattleFields
void RelocateDeadPlayers() void RelocateDeadPlayers()
{ {
WorldSafeLocsRecord closestGrave = null; WorldSafeLocsEntry closestGrave = null;
foreach (var guid in m_ResurrectQueue) foreach (var guid in m_ResurrectQueue)
{ {
Player player = Global.ObjAccessor.FindPlayer(guid); Player player = Global.ObjAccessor.FindPlayer(guid);
@@ -972,12 +972,12 @@ namespace Game.BattleFields
continue; continue;
if (closestGrave != null) if (closestGrave != null)
player.TeleportTo(player.GetMapId(), closestGrave.Loc.X, closestGrave.Loc.Y, closestGrave.Loc.Z, player.GetOrientation()); player.TeleportTo(closestGrave.Loc);
else else
{ {
closestGrave = m_Bf.GetClosestGraveYard(player); closestGrave = m_Bf.GetClosestGraveYard(player);
if (closestGrave != null) if (closestGrave != null)
player.TeleportTo(player.GetMapId(), closestGrave.Loc.X, closestGrave.Loc.Y, closestGrave.Loc.Z, player.GetOrientation()); player.TeleportTo(closestGrave.Loc);
} }
} }
} }
+6 -6
View File
@@ -966,9 +966,9 @@ namespace Game.BattleGrounds
public void TeleportPlayerToExploitLocation(Player player) public void TeleportPlayerToExploitLocation(Player player)
{ {
WorldSafeLocsRecord loc = GetExploitTeleportLocation(player.GetBGTeam()); WorldSafeLocsEntry loc = GetExploitTeleportLocation(player.GetBGTeam());
if (loc != null) if (loc != null)
player.TeleportTo(loc.MapID, loc.Loc.X, loc.Loc.Y, loc.Loc.Z, loc.Facing); player.TeleportTo(loc.Loc);
} }
public virtual void AddPlayer(Player player) public virtual void AddPlayer(Player player)
@@ -1292,7 +1292,7 @@ namespace Game.BattleGrounds
List<ObjectGuid> ghostList = m_ReviveQueue[guideGuid]; List<ObjectGuid> ghostList = m_ReviveQueue[guideGuid];
if (!ghostList.Empty()) if (!ghostList.Empty())
{ {
WorldSafeLocsRecord closestGrave = null; WorldSafeLocsEntry closestGrave = null;
foreach (var guid in ghostList) foreach (var guid in ghostList)
{ {
Player player = Global.ObjAccessor.FindPlayer(guid); Player player = Global.ObjAccessor.FindPlayer(guid);
@@ -1303,7 +1303,7 @@ namespace Game.BattleGrounds
closestGrave = GetClosestGraveYard(player); closestGrave = GetClosestGraveYard(player);
if (closestGrave != null) if (closestGrave != null)
player.TeleportTo(GetMapId(), closestGrave.Loc.X, closestGrave.Loc.Y, closestGrave.Loc.Z, player.GetOrientation()); player.TeleportTo(closestGrave.Loc);
} }
ghostList.Clear(); ghostList.Clear();
} }
@@ -1735,7 +1735,7 @@ namespace Game.BattleGrounds
m_BgRaids[GetTeamIndexByTeamId(team)] = bg_raid; m_BgRaids[GetTeamIndexByTeamId(team)] = bg_raid;
} }
public virtual WorldSafeLocsRecord GetClosestGraveYard(Player player) public virtual WorldSafeLocsEntry GetClosestGraveYard(Player player)
{ {
return Global.ObjectMgr.GetClosestGraveYard(player, player.GetTeam(), player); return Global.ObjectMgr.GetClosestGraveYard(player, player.GetTeam(), player);
} }
@@ -1926,7 +1926,7 @@ namespace Game.BattleGrounds
public virtual void HandlePlayerResurrect(Player player) { } public virtual void HandlePlayerResurrect(Player player) { }
public virtual WorldSafeLocsRecord GetExploitTeleportLocation(Team team) { return null; } public virtual WorldSafeLocsEntry GetExploitTeleportLocation(Team team) { return null; }
public virtual bool HandlePlayerUnderMap(Player player) { return false; } public virtual bool HandlePlayerUnderMap(Player player) { return false; }
@@ -451,10 +451,10 @@ namespace Game.BattleGrounds
if (bgTemplate.Id != BattlegroundTypeId.AA && bgTemplate.Id != BattlegroundTypeId.RB) if (bgTemplate.Id != BattlegroundTypeId.AA && bgTemplate.Id != BattlegroundTypeId.RB)
{ {
uint startId = result.Read<uint>(5); uint startId = result.Read<uint>(5);
if (CliDB.WorldSafeLocsStorage.ContainsKey(startId)) WorldSafeLocsEntry start = Global.ObjectMgr.GetWorldSafeLoc(startId);
if (start != null)
{ {
WorldSafeLocsRecord start = CliDB.WorldSafeLocsStorage.LookupByKey(startId); bgTemplate.StartLocation[TeamId.Alliance] = start.Loc;
bgTemplate.StartLocation[TeamId.Alliance] = new Position(start.Loc.X, start.Loc.Y, start.Loc.Z, (start.Facing + MathFunctions.PI) / 180);
} }
else else
{ {
@@ -462,11 +462,11 @@ namespace Game.BattleGrounds
continue; continue;
} }
startId = result.Read<uint>(6); startId = result.Read<uint>(6);
if (CliDB.WorldSafeLocsStorage.ContainsKey(startId)) start = Global.ObjectMgr.GetWorldSafeLoc(startId);
if (start != null)
{ {
WorldSafeLocsRecord start = CliDB.WorldSafeLocsStorage.LookupByKey(startId); bgTemplate.StartLocation[TeamId.Horde] = start.Loc;
bgTemplate.StartLocation[TeamId.Horde] = new Position(start.Loc.X, start.Loc.Y, start.Loc.Z, result.Read<float>(8));
} }
else else
{ {
@@ -631,7 +631,7 @@ namespace Game.BattleGrounds.Zones
base.EndBattleground(winner); base.EndBattleground(winner);
} }
public override WorldSafeLocsRecord GetClosestGraveYard(Player player) public override WorldSafeLocsEntry GetClosestGraveYard(Player player)
{ {
int teamIndex = GetTeamIndexByTeamId(player.GetTeam()); int teamIndex = GetTeamIndexByTeamId(player.GetTeam());
@@ -641,7 +641,7 @@ namespace Game.BattleGrounds.Zones
if (m_Nodes[i] == ABNodeStatus.Occupied + teamIndex) if (m_Nodes[i] == ABNodeStatus.Occupied + teamIndex)
nodes.Add(i); nodes.Add(i);
WorldSafeLocsRecord good_entry = null; WorldSafeLocsEntry good_entry = null;
// If so, select the closest node to place ghost on // If so, select the closest node to place ghost on
if (!nodes.Empty()) if (!nodes.Empty())
{ {
@@ -651,10 +651,10 @@ namespace Game.BattleGrounds.Zones
float mindist = 999999.0f; float mindist = 999999.0f;
for (byte i = 0; i < nodes.Count; ++i) for (byte i = 0; i < nodes.Count; ++i)
{ {
WorldSafeLocsRecord entry = CliDB.WorldSafeLocsStorage.LookupByKey(GraveyardIds[nodes[i]]); WorldSafeLocsEntry entry = Global.ObjectMgr.GetWorldSafeLoc(GraveyardIds[nodes[i]]);
if (entry == null) if (entry == null)
continue; continue;
float dist = (entry.Loc.X - plr_x) * (entry.Loc.X - plr_x) + (entry.Loc.Y - plr_y) * (entry.Loc.Y - plr_y); float dist = (entry.Loc.GetPositionX() - plr_x) * (entry.Loc.GetPositionX() - plr_x) + (entry.Loc.GetPositionY() - plr_y) * (entry.Loc.GetPositionY() - plr_y);
if (mindist > dist) if (mindist > dist)
{ {
mindist = dist; mindist = dist;
@@ -665,14 +665,14 @@ namespace Game.BattleGrounds.Zones
} }
// If not, place ghost on starting location // If not, place ghost on starting location
if (good_entry == null) if (good_entry == null)
good_entry = CliDB.WorldSafeLocsStorage.LookupByKey(GraveyardIds[teamIndex + 5]); good_entry = Global.ObjectMgr.GetWorldSafeLoc(GraveyardIds[teamIndex + 5]);
return good_entry; return good_entry;
} }
public override WorldSafeLocsRecord GetExploitTeleportLocation(Team team) public override WorldSafeLocsEntry GetExploitTeleportLocation(Team team)
{ {
return CliDB.WorldSafeLocsStorage.LookupByKey(team == Team.Alliance ? ExploitTeleportLocationAlliance : ExploitTeleportLocationHorde); return Global.ObjectMgr.GetWorldSafeLoc(team == Team.Alliance ? ExploitTeleportLocationAlliance : ExploitTeleportLocationHorde);
} }
public override bool UpdatePlayerScore(Player player, ScoreType type, uint value, bool doAddHonor = true) public override bool UpdatePlayerScore(Player player, ScoreType type, uint value, bool doAddHonor = true)
@@ -757,8 +757,8 @@ namespace Game.BattleGrounds.Zones
public const int WarningNearVictoryScore = 1400; public const int WarningNearVictoryScore = 1400;
public const int MaxTeamScore = 1600; public const int MaxTeamScore = 1600;
public const int ExploitTeleportLocationAlliance = 3705; public const uint ExploitTeleportLocationAlliance = 3705;
public const int ExploitTeleportLocationHorde = 3706; public const uint ExploitTeleportLocationHorde = 3706;
public static Position[] NodePositions = public static Position[] NodePositions =
{ {
+15 -15
View File
@@ -510,15 +510,15 @@ namespace Game.BattleGrounds.Zones
Log.outError(LogFilter.Battleground, "BattlegroundEY: Could not spawn Speedbuff Fel Reaver."); Log.outError(LogFilter.Battleground, "BattlegroundEY: Could not spawn Speedbuff Fel Reaver.");
} }
WorldSafeLocsRecord sg = CliDB.WorldSafeLocsStorage.LookupByKey(EotSGaveyardIds.MainAlliance); WorldSafeLocsEntry sg = Global.ObjectMgr.GetWorldSafeLoc(EotSGaveyardIds.MainAlliance);
if (sg == null || !AddSpiritGuide(EotSCreaturesTypes.SpiritMainAlliance, sg.Loc.X, sg.Loc.Y, sg.Loc.Z, 3.124139f, TeamId.Alliance)) if (sg == null || !AddSpiritGuide(EotSCreaturesTypes.SpiritMainAlliance, sg.Loc.GetPositionX(), sg.Loc.GetPositionY(), sg.Loc.GetPositionZ(), 3.124139f, TeamId.Alliance))
{ {
Log.outError(LogFilter.Sql, "BatteGroundEY: Failed to spawn spirit guide. The battleground was not created."); Log.outError(LogFilter.Sql, "BatteGroundEY: Failed to spawn spirit guide. The battleground was not created.");
return false; return false;
} }
sg = CliDB.WorldSafeLocsStorage.LookupByKey(EotSGaveyardIds.MainHorde); sg = Global.ObjectMgr.GetWorldSafeLoc(EotSGaveyardIds.MainHorde);
if (sg == null || !AddSpiritGuide(EotSCreaturesTypes.SpiritMainHorde, sg.Loc.X, sg.Loc.Y, sg.Loc.Z, 3.193953f, TeamId.Horde)) if (sg == null || !AddSpiritGuide(EotSCreaturesTypes.SpiritMainHorde, sg.Loc.GetPositionX(), sg.Loc.GetPositionY(), sg.Loc.GetPositionZ(), 3.193953f, TeamId.Horde))
{ {
Log.outError(LogFilter.Sql, "BatteGroundEY: Failed to spawn spirit guide. The battleground was not created."); Log.outError(LogFilter.Sql, "BatteGroundEY: Failed to spawn spirit guide. The battleground was not created.");
return false; return false;
@@ -752,8 +752,8 @@ namespace Game.BattleGrounds.Zones
if (!BgCreatures[Point].IsEmpty()) if (!BgCreatures[Point].IsEmpty())
DelCreature(Point); DelCreature(Point);
WorldSafeLocsRecord sg = CliDB.WorldSafeLocsStorage.LookupByKey(EotSMisc.m_CapturingPointTypes[Point].GraveYardId); WorldSafeLocsEntry sg = Global.ObjectMgr.GetWorldSafeLoc(EotSMisc.m_CapturingPointTypes[Point].GraveYardId);
if (sg == null || !AddSpiritGuide(Point, sg.Loc.X, sg.Loc.Y, sg.Loc.Z, 3.124139f, GetTeamIndexByTeamId(Team))) if (sg == null || !AddSpiritGuide(Point, sg.Loc.GetPositionX(), sg.Loc.GetPositionY(), sg.Loc.GetPositionZ(), 3.124139f, GetTeamIndexByTeamId(Team)))
Log.outError(LogFilter.Battleground, "BatteGroundEY: Failed to spawn spirit guide. point: {0}, team: {1}, graveyard_id: {2}", Log.outError(LogFilter.Battleground, "BatteGroundEY: Failed to spawn spirit guide. point: {0}, team: {1}, graveyard_id: {2}",
Point, Team, EotSMisc.m_CapturingPointTypes[Point].GraveYardId); Point, Team, EotSMisc.m_CapturingPointTypes[Point].GraveYardId);
@@ -869,7 +869,7 @@ namespace Game.BattleGrounds.Zones
packet.AddState(0xC0D, 0x17B); packet.AddState(0xC0D, 0x17B);
} }
public override WorldSafeLocsRecord GetClosestGraveYard(Player player) public override WorldSafeLocsEntry GetClosestGraveYard(Player player)
{ {
uint g_id = 0; uint g_id = 0;
@@ -884,9 +884,9 @@ namespace Game.BattleGrounds.Zones
default: return null; default: return null;
} }
WorldSafeLocsRecord entry = null; WorldSafeLocsEntry entry = null;
WorldSafeLocsRecord nearestEntry = null; WorldSafeLocsEntry nearestEntry = null;
entry = CliDB.WorldSafeLocsStorage.LookupByKey(g_id); entry = Global.ObjectMgr.GetWorldSafeLoc(g_id);
nearestEntry = entry; nearestEntry = entry;
if (entry == null) if (entry == null)
@@ -899,19 +899,19 @@ namespace Game.BattleGrounds.Zones
float plr_y = player.GetPositionY(); float plr_y = player.GetPositionY();
float plr_z = player.GetPositionZ(); float plr_z = player.GetPositionZ();
float distance = (entry.Loc.X - plr_x) * (entry.Loc.X - plr_x) + (entry.Loc.Y - plr_y) * (entry.Loc.Y - plr_y) + (entry.Loc.Z - plr_z) * (entry.Loc.Z - plr_z); float distance = (entry.Loc.GetPositionX() - plr_x) * (entry.Loc.GetPositionX() - plr_x) + (entry.Loc.GetPositionY() - plr_y) * (entry.Loc.GetPositionY() - plr_y) + (entry.Loc.GetPositionZ() - plr_z) * (entry.Loc.GetPositionZ() - plr_z);
float nearestDistance = distance; float nearestDistance = distance;
for (byte i = 0; i < EotSPoints.PointsMax; ++i) for (byte i = 0; i < EotSPoints.PointsMax; ++i)
{ {
if (m_PointOwnedByTeam[i] == player.GetTeam() && m_PointState[i] == EotSPointState.UnderControl) if (m_PointOwnedByTeam[i] == player.GetTeam() && m_PointState[i] == EotSPointState.UnderControl)
{ {
entry = CliDB.WorldSafeLocsStorage.LookupByKey(EotSMisc.m_CapturingPointTypes[i].GraveYardId); entry = Global.ObjectMgr.GetWorldSafeLoc(EotSMisc.m_CapturingPointTypes[i].GraveYardId);
if (entry == null) if (entry == null)
Log.outError(LogFilter.Battleground, "BattlegroundEY: Graveyard {0} could not be found.", EotSMisc.m_CapturingPointTypes[i].GraveYardId); Log.outError(LogFilter.Battleground, "BattlegroundEY: Graveyard {0} could not be found.", EotSMisc.m_CapturingPointTypes[i].GraveYardId);
else else
{ {
distance = (entry.Loc.X - plr_x) * (entry.Loc.X - plr_x) + (entry.Loc.Y - plr_y) * (entry.Loc.Y - plr_y) + (entry.Loc.Z - plr_z) * (entry.Loc.Z - plr_z); distance = (entry.Loc.GetPositionX() - plr_x) * (entry.Loc.GetPositionX() - plr_x) + (entry.Loc.GetPositionY() - plr_y) * (entry.Loc.GetPositionY() - plr_y) + (entry.Loc.GetPositionZ() - plr_z) * (entry.Loc.GetPositionZ() - plr_z);
if (distance < nearestDistance) if (distance < nearestDistance)
{ {
nearestDistance = distance; nearestDistance = distance;
@@ -924,9 +924,9 @@ namespace Game.BattleGrounds.Zones
return nearestEntry; return nearestEntry;
} }
public override WorldSafeLocsRecord GetExploitTeleportLocation(Team team) public override WorldSafeLocsEntry GetExploitTeleportLocation(Team team)
{ {
return CliDB.WorldSafeLocsStorage.LookupByKey(team == Team.Alliance ? EotSMisc.ExploitTeleportLocationAlliance : EotSMisc.ExploitTeleportLocationHorde); return Global.ObjectMgr.GetWorldSafeLoc(team == Team.Alliance ? EotSMisc.ExploitTeleportLocationAlliance : EotSMisc.ExploitTeleportLocationHorde);
} }
public override bool IsAllNodesControlledByTeam(Team team) public override bool IsAllNodesControlledByTeam(Team team)
@@ -180,7 +180,7 @@ namespace Game.BattleGrounds.Zones
//Graveyards //Graveyards
for (byte i = 0; i < SAGraveyards.Max; i++) for (byte i = 0; i < SAGraveyards.Max; i++)
{ {
WorldSafeLocsRecord sg = CliDB.WorldSafeLocsStorage.LookupByKey(SAMiscConst.GYEntries[i]); WorldSafeLocsEntry sg = Global.ObjectMgr.GetWorldSafeLoc(SAMiscConst.GYEntries[i]);
if (sg == null) if (sg == null)
{ {
Log.outError(LogFilter.Battleground, "SOTA: Can't find GY entry %u", SAMiscConst.GYEntries[i]); Log.outError(LogFilter.Battleground, "SOTA: Can't find GY entry %u", SAMiscConst.GYEntries[i]);
@@ -190,12 +190,12 @@ namespace Game.BattleGrounds.Zones
if (i == SAGraveyards.BeachGy) if (i == SAGraveyards.BeachGy)
{ {
GraveyardStatus[i] = Attackers; GraveyardStatus[i] = Attackers;
AddSpiritGuide(i + SACreatureTypes.Max, sg.Loc.X, sg.Loc.Y, sg.Loc.Z, SAMiscConst.GYOrientation[i], Attackers); AddSpiritGuide(i + SACreatureTypes.Max, sg.Loc.GetPositionX(), sg.Loc.GetPositionY(), sg.Loc.GetPositionZ(), SAMiscConst.GYOrientation[i], Attackers);
} }
else else
{ {
GraveyardStatus[i] = ((Attackers == TeamId.Horde) ? TeamId.Alliance : TeamId.Horde); GraveyardStatus[i] = ((Attackers == TeamId.Horde) ? TeamId.Alliance : TeamId.Horde);
if (!AddSpiritGuide(i + SACreatureTypes.Max, sg.Loc.X, sg.Loc.Y, sg.Loc.Z, SAMiscConst.GYOrientation[i], Attackers == TeamId.Horde ? TeamId.Alliance : TeamId.Horde)) if (!AddSpiritGuide(i + SACreatureTypes.Max, sg.Loc.GetPositionX(), sg.Loc.GetPositionY(), sg.Loc.GetPositionZ(), SAMiscConst.GYOrientation[i], Attackers == TeamId.Horde ? TeamId.Alliance : TeamId.Horde))
Log.outError(LogFilter.Battleground, "SOTA: couldn't spawn GY: %u", i); Log.outError(LogFilter.Battleground, "SOTA: couldn't spawn GY: %u", i);
} }
} }
@@ -700,7 +700,7 @@ namespace Game.BattleGrounds.Zones
{ {
} }
public override WorldSafeLocsRecord GetClosestGraveYard(Player player) public override WorldSafeLocsEntry GetClosestGraveYard(Player player)
{ {
uint safeloc = 0; uint safeloc = 0;
@@ -709,16 +709,16 @@ namespace Game.BattleGrounds.Zones
else else
safeloc = SAMiscConst.GYEntries[SAGraveyards.DefenderLastGy]; safeloc = SAMiscConst.GYEntries[SAGraveyards.DefenderLastGy];
WorldSafeLocsRecord closest = CliDB.WorldSafeLocsStorage.LookupByKey(safeloc); WorldSafeLocsEntry closest = Global.ObjectMgr.GetWorldSafeLoc(safeloc);
float nearest = player.GetExactDistSq(closest.Loc.X, closest.Loc.Y, closest.Loc.Z); float nearest = player.GetExactDistSq(closest.Loc);
for (byte i = SAGraveyards.RightCapturableGy; i < SAGraveyards.Max; i++) for (byte i = SAGraveyards.RightCapturableGy; i < SAGraveyards.Max; i++)
{ {
if (GraveyardStatus[i] != player.GetTeamId()) if (GraveyardStatus[i] != player.GetTeamId())
continue; continue;
WorldSafeLocsRecord ret = CliDB.WorldSafeLocsStorage.LookupByKey(SAMiscConst.GYEntries[i]); WorldSafeLocsEntry ret = Global.ObjectMgr.GetWorldSafeLoc(SAMiscConst.GYEntries[i]);
float dist = player.GetExactDistSq(ret.Loc.X, ret.Loc.Y, ret.Loc.Z); float dist = player.GetExactDistSq(ret.Loc);
if (dist < nearest) if (dist < nearest)
{ {
closest = ret; closest = ret;
@@ -812,14 +812,14 @@ namespace Game.BattleGrounds.Zones
DelCreature(SACreatureTypes.Max + i); DelCreature(SACreatureTypes.Max + i);
GraveyardStatus[i] = Source.GetTeamId(); GraveyardStatus[i] = Source.GetTeamId();
WorldSafeLocsRecord sg = CliDB.WorldSafeLocsStorage.LookupByKey(SAMiscConst.GYEntries[i]); WorldSafeLocsEntry sg = Global.ObjectMgr.GetWorldSafeLoc(SAMiscConst.GYEntries[i]);
if (sg == null) if (sg == null)
{ {
Log.outError(LogFilter.Battleground, "CaptureGraveyard: non-existant GY entry: %u", SAMiscConst.GYEntries[i]); Log.outError(LogFilter.Battleground, $"CaptureGraveyard: non-existant GY entry: {SAMiscConst.GYEntries[i]}");
return; return;
} }
AddSpiritGuide(i + SACreatureTypes.Max, sg.Loc.X, sg.Loc.Y, sg.Loc.Z, SAMiscConst.GYOrientation[i], GraveyardStatus[i]); AddSpiritGuide(i + SACreatureTypes.Max, sg.Loc.GetPositionX(), sg.Loc.GetPositionY(), sg.Loc.GetPositionZ(), SAMiscConst.GYOrientation[i], GraveyardStatus[i]);
uint npc = 0; uint npc = 0;
int flag = 0; int flag = 0;
+11 -11
View File
@@ -703,15 +703,15 @@ namespace Game.BattleGrounds.Zones
return false; return false;
} }
WorldSafeLocsRecord sg = CliDB.WorldSafeLocsStorage.LookupByKey(WSGGraveyards.MainAlliance); WorldSafeLocsEntry sg = Global.ObjectMgr.GetWorldSafeLoc(WSGGraveyards.MainAlliance);
if (sg == null || !AddSpiritGuide(WSGCreatureTypes.SpiritMainAlliance, sg.Loc.X, sg.Loc.Y, sg.Loc.Z, 3.124139f, TeamId.Alliance)) if (sg == null || !AddSpiritGuide(WSGCreatureTypes.SpiritMainAlliance, sg.Loc.GetPositionX(), sg.Loc.GetPositionY(), sg.Loc.GetPositionZ(), 3.124139f, TeamId.Alliance))
{ {
Log.outError(LogFilter.Sql, "BgWarsongGluch: Failed to spawn Alliance spirit guide! Battleground not created!"); Log.outError(LogFilter.Sql, "BgWarsongGluch: Failed to spawn Alliance spirit guide! Battleground not created!");
return false; return false;
} }
sg = CliDB.WorldSafeLocsStorage.LookupByKey(WSGGraveyards.MainHorde); sg = Global.ObjectMgr.GetWorldSafeLoc(WSGGraveyards.MainHorde);
if (sg == null || !AddSpiritGuide(WSGCreatureTypes.SpiritMainHorde, sg.Loc.X, sg.Loc.Y, sg.Loc.Z, 3.193953f, TeamId.Horde)) if (sg == null || !AddSpiritGuide(WSGCreatureTypes.SpiritMainHorde, sg.Loc.GetPositionX(), sg.Loc.GetPositionY(), sg.Loc.GetPositionZ(), 3.193953f, TeamId.Horde))
{ {
Log.outError(LogFilter.Sql, "BgWarsongGluch: Failed to spawn Horde spirit guide! Battleground not created!"); Log.outError(LogFilter.Sql, "BgWarsongGluch: Failed to spawn Horde spirit guide! Battleground not created!");
return false; return false;
@@ -800,7 +800,7 @@ namespace Game.BattleGrounds.Zones
return true; return true;
} }
public override WorldSafeLocsRecord GetClosestGraveYard(Player player) public override WorldSafeLocsEntry GetClosestGraveYard(Player player)
{ {
//if status in progress, it returns main graveyards with spiritguides //if status in progress, it returns main graveyards with spiritguides
//else it will return the graveyard in the flagroom - this is especially good //else it will return the graveyard in the flagroom - this is especially good
@@ -810,22 +810,22 @@ namespace Game.BattleGrounds.Zones
if (player.GetTeam() == Team.Alliance) if (player.GetTeam() == Team.Alliance)
{ {
if (GetStatus() == BattlegroundStatus.InProgress) if (GetStatus() == BattlegroundStatus.InProgress)
return CliDB.WorldSafeLocsStorage.LookupByKey(WSGGraveyards.MainAlliance); return Global.ObjectMgr.GetWorldSafeLoc(WSGGraveyards.MainAlliance);
else else
return CliDB.WorldSafeLocsStorage.LookupByKey(WSGGraveyards.FlagRoomAlliance); return Global.ObjectMgr.GetWorldSafeLoc(WSGGraveyards.FlagRoomAlliance);
} }
else else
{ {
if (GetStatus() == BattlegroundStatus.InProgress) if (GetStatus() == BattlegroundStatus.InProgress)
return CliDB.WorldSafeLocsStorage.LookupByKey(WSGGraveyards.MainHorde); return Global.ObjectMgr.GetWorldSafeLoc(WSGGraveyards.MainHorde);
else else
return CliDB.WorldSafeLocsStorage.LookupByKey(WSGGraveyards.FlagRoomHorde); return Global.ObjectMgr.GetWorldSafeLoc(WSGGraveyards.FlagRoomHorde);
} }
} }
public override WorldSafeLocsRecord GetExploitTeleportLocation(Team team) public override WorldSafeLocsEntry GetExploitTeleportLocation(Team team)
{ {
return CliDB.WorldSafeLocsStorage.LookupByKey(team == Team.Alliance ? ExploitTeleportLocationAlliance : ExploitTeleportLocationHorde); return Global.ObjectMgr.GetWorldSafeLoc(team == Team.Alliance ? ExploitTeleportLocationAlliance : ExploitTeleportLocationHorde);
} }
public override void FillInitialWorldStates(InitWorldStates packet) public override void FillInitialWorldStates(InitWorldStates packet)
+7 -6
View File
@@ -550,7 +550,7 @@ namespace Game.Chat
static bool HandleDebugNearGraveyard(StringArguments args, CommandHandler handler) static bool HandleDebugNearGraveyard(StringArguments args, CommandHandler handler)
{ {
Player player = handler.GetSession().GetPlayer(); Player player = handler.GetSession().GetPlayer();
WorldSafeLocsRecord nearestLoc = null; WorldSafeLocsEntry nearestLoc = null;
if (args.NextString().Equals("linked")) if (args.NextString().Equals("linked"))
{ {
@@ -573,22 +573,23 @@ namespace Game.Chat
float z = player.GetPositionZ(); float z = player.GetPositionZ();
float distNearest = float.MaxValue; float distNearest = float.MaxValue;
foreach (var loc in CliDB.WorldSafeLocsStorage.Values) foreach (var pair in Global.ObjectMgr.GetWorldSafeLocs())
{ {
if (loc.MapID == player.GetMapId()) var worldSafe = pair.Value;
if (worldSafe.Loc.GetMapId() == player.GetMapId())
{ {
float dist = (loc.Loc.X - x) * (loc.Loc.X - x) + (loc.Loc.Y - y) * (loc.Loc.Y - y) + (loc.Loc.Z - z) * (loc.Loc.Z - z); float dist = (worldSafe.Loc.GetPositionX() - x) * (worldSafe.Loc.GetPositionX() - x) + (worldSafe.Loc.GetPositionY() - y) * (worldSafe.Loc.GetPositionY() - y) + (worldSafe.Loc.GetPositionZ() - z) * (worldSafe.Loc.GetPositionZ() - z);
if (dist < distNearest) if (dist < distNearest)
{ {
distNearest = dist; distNearest = dist;
nearestLoc = loc; nearestLoc = worldSafe;
} }
} }
} }
} }
if (nearestLoc != null) if (nearestLoc != null)
handler.SendSysMessage(CypherStrings.CommandNearGraveyard, nearestLoc.Id, nearestLoc.Loc.X, nearestLoc.Loc.Y, nearestLoc.Loc.Z); handler.SendSysMessage(CypherStrings.CommandNearGraveyard, nearestLoc.Id, nearestLoc.Loc.GetPositionX(), nearestLoc.Loc.GetPositionY(), nearestLoc.Loc.GetPositionZ());
else else
handler.SendSysMessage(CypherStrings.CommandNearGraveyardNotfound); handler.SendSysMessage(CypherStrings.CommandNearGraveyardNotfound);
+4 -4
View File
@@ -113,16 +113,16 @@ namespace Game.Chat.Commands
if (graveyardId == 0) if (graveyardId == 0)
return false; return false;
WorldSafeLocsRecord gy = CliDB.WorldSafeLocsStorage.LookupByKey(graveyardId); WorldSafeLocsEntry gy = Global.ObjectMgr.GetWorldSafeLoc(graveyardId);
if (gy == null) if (gy == null)
{ {
handler.SendSysMessage(CypherStrings.CommandGraveyardnoexist, graveyardId); handler.SendSysMessage(CypherStrings.CommandGraveyardnoexist, graveyardId);
return false; return false;
} }
if (!GridDefines.IsValidMapCoord(gy.MapID, gy.Loc.X, gy.Loc.Y, gy.Loc.Z)) if (!GridDefines.IsValidMapCoord(gy.Loc))
{ {
handler.SendSysMessage(CypherStrings.InvalidTargetCoord, gy.Loc.X, gy.Loc.Y, gy.MapID); handler.SendSysMessage(CypherStrings.InvalidTargetCoord, gy.Loc.GetPositionX(), gy.Loc.GetPositionY(), gy.Loc.GetMapId());
return false; return false;
} }
@@ -136,7 +136,7 @@ namespace Game.Chat.Commands
else else
player.SaveRecallPosition(); player.SaveRecallPosition();
player.TeleportTo(gy.MapID, gy.Loc.X, gy.Loc.Y, gy.Loc.Z, (gy.Facing * MathFunctions.PI) / 180); // Orientation is initially in degrees player.TeleportTo(gy.Loc);
return true; return true;
} }
+2 -2
View File
@@ -1069,7 +1069,7 @@ namespace Game.Chat
else else
return false; return false;
WorldSafeLocsRecord graveyard = CliDB.WorldSafeLocsStorage.LookupByKey(graveyardId); WorldSafeLocsEntry graveyard = Global.ObjectMgr.GetWorldSafeLoc(graveyardId);
if (graveyard == null) if (graveyard == null)
{ {
handler.SendSysMessage(CypherStrings.CommandGraveyardnoexist, graveyardId); handler.SendSysMessage(CypherStrings.CommandGraveyardnoexist, graveyardId);
@@ -1112,7 +1112,7 @@ namespace Game.Chat
Player player = handler.GetSession().GetPlayer(); Player player = handler.GetSession().GetPlayer();
uint zone_id = player.GetZoneId(); uint zone_id = player.GetZoneId();
WorldSafeLocsRecord graveyard = Global.ObjectMgr.GetClosestGraveYard(player, team, null); WorldSafeLocsEntry graveyard = Global.ObjectMgr.GetClosestGraveYard(player, team, null);
if (graveyard != null) if (graveyard != null)
{ {
uint graveyardId = graveyard.Id; uint graveyardId = graveyard.Id;
+1 -1
View File
@@ -1073,7 +1073,7 @@ namespace Game
case ConditionSourceType.SmartEvent: case ConditionSourceType.SmartEvent:
break; break;
case ConditionSourceType.Graveyard: case ConditionSourceType.Graveyard:
if (!CliDB.WorldSafeLocsStorage.ContainsKey(cond.SourceEntry)) if (Global.ObjectMgr.GetWorldSafeLoc((uint)cond.SourceEntry) == null)
{ {
Log.outError(LogFilter.Sql, $"{cond.ToString()} SourceEntry in `condition` table, does not exist in WorldSafeLocs.db2, ignoring."); Log.outError(LogFilter.Sql, $"{cond.ToString()} SourceEntry in `condition` table, does not exist in WorldSafeLocs.db2, ignoring.");
return false; return false;
-6
View File
@@ -161,7 +161,6 @@ namespace Game.DataStorage
ItemSparseStorage = DBReader.Read<ItemSparseRecord>("ItemSparse.db2", HotfixStatements.SEL_ITEM_SPARSE, HotfixStatements.SEL_ITEM_SPARSE_LOCALE); ItemSparseStorage = DBReader.Read<ItemSparseRecord>("ItemSparse.db2", HotfixStatements.SEL_ITEM_SPARSE, HotfixStatements.SEL_ITEM_SPARSE_LOCALE);
ItemSpecStorage = DBReader.Read<ItemSpecRecord>("ItemSpec.db2", HotfixStatements.SEL_ITEM_SPEC); ItemSpecStorage = DBReader.Read<ItemSpecRecord>("ItemSpec.db2", HotfixStatements.SEL_ITEM_SPEC);
ItemSpecOverrideStorage = DBReader.Read<ItemSpecOverrideRecord>("ItemSpecOverride.db2", HotfixStatements.SEL_ITEM_SPEC_OVERRIDE); ItemSpecOverrideStorage = DBReader.Read<ItemSpecOverrideRecord>("ItemSpecOverride.db2", HotfixStatements.SEL_ITEM_SPEC_OVERRIDE);
ItemUpgradeStorage = DBReader.Read<ItemUpgradeRecord>("ItemUpgrade.db2", HotfixStatements.SEL_ITEM_UPGRADE);
ItemXBonusTreeStorage = DBReader.Read<ItemXBonusTreeRecord>("ItemXBonusTree.db2", HotfixStatements.SEL_ITEM_X_BONUS_TREE); ItemXBonusTreeStorage = DBReader.Read<ItemXBonusTreeRecord>("ItemXBonusTree.db2", HotfixStatements.SEL_ITEM_X_BONUS_TREE);
//KeyChainStorage = DBReader.Read<KeyChainRecord>("KeyChain.db2", HotfixStatements.SEL_KEYCHAIN); //KeyChainStorage = DBReader.Read<KeyChainRecord>("KeyChain.db2", HotfixStatements.SEL_KEYCHAIN);
LFGDungeonsStorage = DBReader.Read<LFGDungeonsRecord>("LFGDungeons.db2", HotfixStatements.SEL_LFG_DUNGEONS, HotfixStatements.SEL_LFG_DUNGEONS_LOCALE); LFGDungeonsStorage = DBReader.Read<LFGDungeonsRecord>("LFGDungeons.db2", HotfixStatements.SEL_LFG_DUNGEONS, HotfixStatements.SEL_LFG_DUNGEONS_LOCALE);
@@ -204,7 +203,6 @@ namespace Game.DataStorage
RewardPackStorage = DBReader.Read<RewardPackRecord>("RewardPack.db2", HotfixStatements.SEL_REWARD_PACK); RewardPackStorage = DBReader.Read<RewardPackRecord>("RewardPack.db2", HotfixStatements.SEL_REWARD_PACK);
RewardPackXCurrencyTypeStorage = DBReader.Read<RewardPackXCurrencyTypeRecord>("RewardPackXCurrencyType.db2", HotfixStatements.SEL_REWARD_PACK_X_CURRENCY_TYPE); RewardPackXCurrencyTypeStorage = DBReader.Read<RewardPackXCurrencyTypeRecord>("RewardPackXCurrencyType.db2", HotfixStatements.SEL_REWARD_PACK_X_CURRENCY_TYPE);
RewardPackXItemStorage = DBReader.Read<RewardPackXItemRecord>("RewardPackXItem.db2", HotfixStatements.SEL_REWARD_PACK_X_ITEM); RewardPackXItemStorage = DBReader.Read<RewardPackXItemRecord>("RewardPackXItem.db2", HotfixStatements.SEL_REWARD_PACK_X_ITEM);
RulesetItemUpgradeStorage = DBReader.Read<RulesetItemUpgradeRecord>("RulesetItemUpgrade.db2", HotfixStatements.SEL_RULESET_ITEM_UPGRADE);
ScalingStatDistributionStorage = DBReader.Read<ScalingStatDistributionRecord>("ScalingStatDistribution.db2", HotfixStatements.SEL_SCALING_STAT_DISTRIBUTION); ScalingStatDistributionStorage = DBReader.Read<ScalingStatDistributionRecord>("ScalingStatDistribution.db2", HotfixStatements.SEL_SCALING_STAT_DISTRIBUTION);
ScenarioStorage = DBReader.Read<ScenarioRecord>("Scenario.db2", HotfixStatements.SEL_SCENARIO, HotfixStatements.SEL_SCENARIO_LOCALE); ScenarioStorage = DBReader.Read<ScenarioRecord>("Scenario.db2", HotfixStatements.SEL_SCENARIO, HotfixStatements.SEL_SCENARIO_LOCALE);
ScenarioStepStorage = DBReader.Read<ScenarioStepRecord>("ScenarioStep.db2", HotfixStatements.SEL_SCENARIO_STEP, HotfixStatements.SEL_SCENARIO_STEP_LOCALE); ScenarioStepStorage = DBReader.Read<ScenarioStepRecord>("ScenarioStep.db2", HotfixStatements.SEL_SCENARIO_STEP, HotfixStatements.SEL_SCENARIO_STEP_LOCALE);
@@ -274,7 +272,6 @@ namespace Game.DataStorage
WMOAreaTableStorage = DBReader.Read<WMOAreaTableRecord>("WMOAreaTable.db2", HotfixStatements.SEL_WMO_AREA_TABLE, HotfixStatements.SEL_WMO_AREA_TABLE_LOCALE); WMOAreaTableStorage = DBReader.Read<WMOAreaTableRecord>("WMOAreaTable.db2", HotfixStatements.SEL_WMO_AREA_TABLE, HotfixStatements.SEL_WMO_AREA_TABLE_LOCALE);
WorldEffectStorage = DBReader.Read<WorldEffectRecord>("WorldEffect.db2", HotfixStatements.SEL_WORLD_EFFECT); WorldEffectStorage = DBReader.Read<WorldEffectRecord>("WorldEffect.db2", HotfixStatements.SEL_WORLD_EFFECT);
WorldMapOverlayStorage = DBReader.Read<WorldMapOverlayRecord>("WorldMapOverlay.db2", HotfixStatements.SEL_WORLD_MAP_OVERLAY); WorldMapOverlayStorage = DBReader.Read<WorldMapOverlayRecord>("WorldMapOverlay.db2", HotfixStatements.SEL_WORLD_MAP_OVERLAY);
WorldSafeLocsStorage = DBReader.Read<WorldSafeLocsRecord>("WorldSafeLocs.db2", HotfixStatements.SEL_WORLD_SAFE_LOCS, HotfixStatements.SEL_WORLD_SAFE_LOCS_LOCALE);
WorldStateExpressionStorage = DBReader.Read<WorldStateExpressionRecord>("WorldStateExpression.db2", HotfixStatements.SEL_WORLD_STATE_EXPRESSION); WorldStateExpressionStorage = DBReader.Read<WorldStateExpressionRecord>("WorldStateExpression.db2", HotfixStatements.SEL_WORLD_STATE_EXPRESSION);
Global.DB2Mgr.LoadStores(); Global.DB2Mgr.LoadStores();
@@ -507,7 +504,6 @@ namespace Game.DataStorage
public static DB6Storage<ItemSparseRecord> ItemSparseStorage; public static DB6Storage<ItemSparseRecord> ItemSparseStorage;
public static DB6Storage<ItemSpecRecord> ItemSpecStorage; public static DB6Storage<ItemSpecRecord> ItemSpecStorage;
public static DB6Storage<ItemSpecOverrideRecord> ItemSpecOverrideStorage; public static DB6Storage<ItemSpecOverrideRecord> ItemSpecOverrideStorage;
public static DB6Storage<ItemUpgradeRecord> ItemUpgradeStorage;
public static DB6Storage<ItemXBonusTreeRecord> ItemXBonusTreeStorage; public static DB6Storage<ItemXBonusTreeRecord> ItemXBonusTreeStorage;
//public static DB6Storage<KeyChainRecord> KeyChainStorage; //public static DB6Storage<KeyChainRecord> KeyChainStorage;
public static DB6Storage<LFGDungeonsRecord> LFGDungeonsStorage; public static DB6Storage<LFGDungeonsRecord> LFGDungeonsStorage;
@@ -550,7 +546,6 @@ namespace Game.DataStorage
public static DB6Storage<RewardPackRecord> RewardPackStorage; public static DB6Storage<RewardPackRecord> RewardPackStorage;
public static DB6Storage<RewardPackXCurrencyTypeRecord> RewardPackXCurrencyTypeStorage; public static DB6Storage<RewardPackXCurrencyTypeRecord> RewardPackXCurrencyTypeStorage;
public static DB6Storage<RewardPackXItemRecord> RewardPackXItemStorage; public static DB6Storage<RewardPackXItemRecord> RewardPackXItemStorage;
public static DB6Storage<RulesetItemUpgradeRecord> RulesetItemUpgradeStorage;
public static DB6Storage<ScalingStatDistributionRecord> ScalingStatDistributionStorage; public static DB6Storage<ScalingStatDistributionRecord> ScalingStatDistributionStorage;
public static DB6Storage<ScenarioRecord> ScenarioStorage; public static DB6Storage<ScenarioRecord> ScenarioStorage;
public static DB6Storage<ScenarioStepRecord> ScenarioStepStorage; public static DB6Storage<ScenarioStepRecord> ScenarioStepStorage;
@@ -620,7 +615,6 @@ namespace Game.DataStorage
public static DB6Storage<WMOAreaTableRecord> WMOAreaTableStorage; public static DB6Storage<WMOAreaTableRecord> WMOAreaTableStorage;
public static DB6Storage<WorldEffectRecord> WorldEffectStorage; public static DB6Storage<WorldEffectRecord> WorldEffectStorage;
public static DB6Storage<WorldMapOverlayRecord> WorldMapOverlayStorage; public static DB6Storage<WorldMapOverlayRecord> WorldMapOverlayStorage;
public static DB6Storage<WorldSafeLocsRecord> WorldSafeLocsStorage;
public static DB6Storage<WorldStateExpressionRecord> WorldStateExpressionStorage; public static DB6Storage<WorldStateExpressionRecord> WorldStateExpressionStorage;
#endregion #endregion
@@ -127,11 +127,13 @@ namespace Game.DataStorage
} }
long previousStringTableSize = 0; long previousStringTableSize = 0;
long previousRecordCount = 0;
for (int sectionIndex = 0; sectionIndex < Header.SectionsCount; sectionIndex++) for (int sectionIndex = 0; sectionIndex < Header.SectionsCount; sectionIndex++)
{ {
if (sections[sectionIndex].TactKeyLookup != 0)// && !hasTactKeyFunc(sections[sectionIndex].TactKeyLookup)) if (sections[sectionIndex].TactKeyLookup != 0)// && !hasTactKeyFunc(sections[sectionIndex].TactKeyLookup))
{ {
previousStringTableSize += sections[sectionIndex].StringTableSize; previousStringTableSize += sections[sectionIndex].StringTableSize;
previousRecordCount += sections[sectionIndex].NumRecords;
//Console.WriteLine("Detected db2 with encrypted section! HasKey {0}", CASC.HasKey(Sections[sectionIndex].TactKeyLookup)); //Console.WriteLine("Detected db2 with encrypted section! HasKey {0}", CASC.HasKey(Sections[sectionIndex].TactKeyLookup));
continue; continue;
} }
@@ -150,17 +152,11 @@ namespace Game.DataStorage
// string data // string data
stringsTable = new Dictionary<long, string>(); stringsTable = new Dictionary<long, string>();
long stringDataOffset = 0;
if (sectionIndex == 0)
stringDataOffset = (Header.RecordCount - sections[sectionIndex].NumRecords) * Header.RecordSize;
else
stringDataOffset = previousStringTableSize;
for (int i = 0; i < sections[sectionIndex].StringTableSize;) for (int i = 0; i < sections[sectionIndex].StringTableSize;)
{ {
long oldPos = reader.BaseStream.Position; long oldPos = reader.BaseStream.Position;
stringsTable[oldPos + stringDataOffset] = reader.ReadCString(); stringsTable[i + previousStringTableSize] = reader.ReadCString();
i += (int)(reader.BaseStream.Position - oldPos); i += (int)(reader.BaseStream.Position - oldPos);
} }
@@ -238,7 +234,10 @@ namespace Game.DataStorage
bool hasRef = refData.Entries.TryGetValue(i, out int refId); bool hasRef = refData.Entries.TryGetValue(i, out int refId);
var rec = new WDC3Row(this, bitReader, sections[sectionIndex].FileOffset, Header.HasIndexTable() ? (isIndexEmpty ? i : indexData[i]) : -1, hasRef ? refId : -1, stringsTable); long recordIndex = i + previousRecordCount;
long recordOffset = (recordIndex * Header.RecordSize) - (Header.RecordCount * Header.RecordSize);
var rec = new WDC3Row(this, bitReader, (int)recordOffset, Header.HasIndexTable() ? (isIndexEmpty ? i : indexData[i]) : -1, hasRef ? refId : -1, stringsTable);
_records.Add(rec.Id, rec); _records.Add(rec.Id, rec);
} }
@@ -250,6 +249,7 @@ namespace Game.DataStorage
} }
previousStringTableSize += sections[sectionIndex].StringTableSize; previousStringTableSize += sections[sectionIndex].StringTableSize;
previousRecordCount += sections[sectionIndex].NumRecords;
} }
} }
@@ -455,7 +455,7 @@ namespace Game.DataStorage
} }
else else
{ {
var pos = _recordsOffset + _data.Offset + (_data.Position >> 3); var pos = _recordsOffset + (_data.Position >> 3);
int[] strIdx = GetFieldValueArray<int>(fieldIndex, atr.Length); int[] strIdx = GetFieldValueArray<int>(fieldIndex, atr.Length);
@@ -522,7 +522,7 @@ namespace Game.DataStorage
} }
else else
{ {
var pos = _recordsOffset + _data.Offset + (_data.Position >> 3); var pos = _recordsOffset + (_data.Position >> 3);
int ofs = GetFieldValue<int>(fieldIndex); int ofs = GetFieldValue<int>(fieldIndex);
f.SetValue(obj, _stringsTable.LookupByKey(pos + ofs)); f.SetValue(obj, _stringsTable.LookupByKey(pos + ofs));
} }
-11
View File
@@ -397,11 +397,6 @@ namespace Game.DataStorage
CliDB.RewardPackXItemStorage.Clear(); CliDB.RewardPackXItemStorage.Clear();
foreach (RulesetItemUpgradeRecord rulesetItemUpgrade in CliDB.RulesetItemUpgradeStorage.Values)
_rulesetItemUpgrade[rulesetItemUpgrade.ItemID] = rulesetItemUpgrade.ItemUpgradeID;
CliDB.RulesetItemUpgradeStorage.Clear();
foreach (SkillLineRecord skill in CliDB.SkillLineStorage.Values) foreach (SkillLineRecord skill in CliDB.SkillLineStorage.Values)
{ {
if (skill.ParentSkillLineID != 0) if (skill.ParentSkillLineID != 0)
@@ -1518,11 +1513,6 @@ namespace Game.DataStorage
return _rewardPackItems.LookupByKey(rewardPackID); return _rewardPackItems.LookupByKey(rewardPackID);
} }
public uint GetRulesetItemUpgrade(uint itemId)
{
return _rulesetItemUpgrade.LookupByKey(itemId);
}
public List<SkillLineRecord> GetSkillLinesForParentSkill(uint parentSkillId) public List<SkillLineRecord> GetSkillLinesForParentSkill(uint parentSkillId)
{ {
return _skillLinesByParentSkillLine.LookupByKey(parentSkillId); return _skillLinesByParentSkillLine.LookupByKey(parentSkillId);
@@ -1982,7 +1972,6 @@ namespace Game.DataStorage
Dictionary<uint, Tuple<List<QuestPackageItemRecord>, List<QuestPackageItemRecord>>> _questPackages = new Dictionary<uint, Tuple<List<QuestPackageItemRecord>, List<QuestPackageItemRecord>>>(); Dictionary<uint, Tuple<List<QuestPackageItemRecord>, List<QuestPackageItemRecord>>> _questPackages = new Dictionary<uint, Tuple<List<QuestPackageItemRecord>, List<QuestPackageItemRecord>>>();
MultiMap<uint, RewardPackXCurrencyTypeRecord> _rewardPackCurrencyTypes = new MultiMap<uint, RewardPackXCurrencyTypeRecord>(); MultiMap<uint, RewardPackXCurrencyTypeRecord> _rewardPackCurrencyTypes = new MultiMap<uint, RewardPackXCurrencyTypeRecord>();
MultiMap<uint, RewardPackXItemRecord> _rewardPackItems = new MultiMap<uint, RewardPackXItemRecord>(); MultiMap<uint, RewardPackXItemRecord> _rewardPackItems = new MultiMap<uint, RewardPackXItemRecord>();
Dictionary<uint, uint> _rulesetItemUpgrade = new Dictionary<uint, uint>();
MultiMap<uint, SkillLineRecord> _skillLinesByParentSkillLine = new MultiMap<uint, SkillLineRecord>(); MultiMap<uint, SkillLineRecord> _skillLinesByParentSkillLine = new MultiMap<uint, SkillLineRecord>();
MultiMap<uint, SkillLineAbilityRecord> _skillLineAbilitiesBySkillupSkill = new MultiMap<uint, SkillLineAbilityRecord>(); MultiMap<uint, SkillLineAbilityRecord> _skillLineAbilitiesBySkillupSkill = new MultiMap<uint, SkillLineAbilityRecord>();
MultiMap<uint, SkillRaceClassInfoRecord> _skillRaceClassInfoBySkill = new MultiMap<uint, SkillRaceClassInfoRecord>(); MultiMap<uint, SkillRaceClassInfoRecord> _skillRaceClassInfoBySkill = new MultiMap<uint, SkillRaceClassInfoRecord>();
+2 -11
View File
@@ -63,6 +63,7 @@ namespace Game.DataStorage
{ {
public uint Id; public uint Id;
public byte DisplayType; public byte DisplayType;
public int SubclassID;
public uint ItemDisplayInfoID; public uint ItemDisplayInfoID;
public int DefaultIconFileDataID; public int DefaultIconFileDataID;
public int UiOrder; public int UiOrder;
@@ -346,7 +347,7 @@ namespace Game.DataStorage
public ushort SocketMatchEnchantmentId; public ushort SocketMatchEnchantmentId;
public ushort TotemCategoryID; public ushort TotemCategoryID;
public ushort InstanceBound; public ushort InstanceBound;
public ushort ZoneBound; public ushort[] ZoneBound = new ushort[2];
public ushort ItemSet; public ushort ItemSet;
public ushort LockID; public ushort LockID;
public ushort StartQuestID; public ushort StartQuestID;
@@ -397,16 +398,6 @@ namespace Game.DataStorage
public uint ItemID; public uint ItemID;
} }
public sealed class ItemUpgradeRecord
{
public uint Id;
public byte ItemUpgradePathID;
public byte ItemLevelIncrement;
public ushort PrerequisiteID;
public ushort CurrencyType;
public uint CurrencyAmount;
}
public sealed class ItemXBonusTreeRecord public sealed class ItemXBonusTreeRecord
{ {
public uint Id; public uint Id;
+1 -1
View File
@@ -129,9 +129,9 @@ namespace Game.DataStorage
public sealed class PowerTypeRecord public sealed class PowerTypeRecord
{ {
public uint Id;
public string NameGlobalStringTag; public string NameGlobalStringTag;
public string CostGlobalStringTag; public string CostGlobalStringTag;
public uint Id;
public PowerType PowerTypeEnum; public PowerType PowerTypeEnum;
public sbyte MinPower; public sbyte MinPower;
public short MaxBasePower; public short MaxBasePower;
@@ -53,11 +53,4 @@ namespace Game.DataStorage
public uint ItemQuantity; public uint ItemQuantity;
public uint RewardPackID; public uint RewardPackID;
} }
public sealed class RulesetItemUpgradeRecord
{
public uint Id;
public uint ItemID;
public ushort ItemUpgradeID;
}
} }
+2 -2
View File
@@ -269,12 +269,12 @@ namespace Game.DataStorage
public sealed class SpellEffectRecord public sealed class SpellEffectRecord
{ {
public uint Id; public uint Id;
public short EffectAura;
public uint DifficultyID; public uint DifficultyID;
public uint EffectIndex; public uint EffectIndex;
public uint Effect; public uint Effect;
public float EffectAmplitude; public float EffectAmplitude;
public int EffectAttributes; public int EffectAttributes;
public short EffectAura;
public uint EffectAuraPeriod; public uint EffectAuraPeriod;
public float EffectBonusCoefficient; public float EffectBonusCoefficient;
public float EffectChainAmplitude; public float EffectChainAmplitude;
@@ -382,6 +382,7 @@ namespace Game.DataStorage
public sealed class SpellMiscRecord public sealed class SpellMiscRecord
{ {
public uint Id; public uint Id;
public int[] Attributes = new int[14];
public byte DifficultyID; public byte DifficultyID;
public ushort CastingTimeIndex; public ushort CastingTimeIndex;
public ushort DurationIndex; public ushort DurationIndex;
@@ -393,7 +394,6 @@ namespace Game.DataStorage
public uint SpellIconFileDataID; public uint SpellIconFileDataID;
public uint ActiveIconFileDataID; public uint ActiveIconFileDataID;
public uint ContentTuningID; public uint ContentTuningID;
public int[] Attributes = new int[14];
public uint SpellID; public uint SpellID;
} }
@@ -117,6 +117,7 @@ namespace Game.DataStorage
public byte ExpansionID; public byte ExpansionID;
public int PatchID; public int PatchID;
public short UiOrder; public short UiOrder;
public uint PlayerConditionID;
} }
public sealed class TransmogSetGroupRecord public sealed class TransmogSetGroupRecord
+1 -1
View File
@@ -79,7 +79,7 @@ namespace Game.DataStorage
public string ToolTip; public string ToolTip;
public uint MinPower; public uint MinPower;
public uint MaxPower; public uint MaxPower;
public ushort StartPower; public uint StartPower;
public byte CenterPower; public byte CenterPower;
public float RegenerationPeace; public float RegenerationPeace;
public float RegenerationCombat; public float RegenerationCombat;
@@ -67,15 +67,6 @@ namespace Game.DataStorage
public uint[] AreaID = new uint[SharedConst.MaxWorldMapOverlayArea]; public uint[] AreaID = new uint[SharedConst.MaxWorldMapOverlayArea];
} }
public sealed class WorldSafeLocsRecord
{
public uint Id;
public string AreaName;
public Vector3 Loc;
public ushort MapID;
public float Facing;
}
public sealed class WorldStateExpressionRecord public sealed class WorldStateExpressionRecord
{ {
public uint Id; public uint Id;
+32 -53
View File
@@ -166,7 +166,6 @@ namespace Game.Entities
stmt.AddValue(++index, (uint)m_itemData.Durability); stmt.AddValue(++index, (uint)m_itemData.Durability);
stmt.AddValue(++index, (uint)m_itemData.CreatePlayedTime); stmt.AddValue(++index, (uint)m_itemData.CreatePlayedTime);
stmt.AddValue(++index, m_text); stmt.AddValue(++index, m_text);
stmt.AddValue(++index, GetModifier(ItemModifier.UpgradeId));
stmt.AddValue(++index, GetModifier(ItemModifier.BattlePetSpeciesId)); stmt.AddValue(++index, GetModifier(ItemModifier.BattlePetSpeciesId));
stmt.AddValue(++index, GetModifier(ItemModifier.BattlePetBreedData)); stmt.AddValue(++index, GetModifier(ItemModifier.BattlePetBreedData));
stmt.AddValue(++index, GetModifier(ItemModifier.BattlePetLevel)); stmt.AddValue(++index, GetModifier(ItemModifier.BattlePetLevel));
@@ -303,7 +302,7 @@ namespace Game.Entities
ItemModifier[] modifiersTable = ItemModifier[] modifiersTable =
{ {
ItemModifier.ScalingStatDistributionFixedLevel, ItemModifier.TimewalkerLevel,
ItemModifier.ArtifactKnowledgeLevel ItemModifier.ArtifactKnowledgeLevel
}; };
@@ -315,7 +314,7 @@ namespace Game.Entities
{ {
stmt = DB.Characters.GetPreparedStatement(CharStatements.INS_ITEM_INSTANCE_MODIFIERS); stmt = DB.Characters.GetPreparedStatement(CharStatements.INS_ITEM_INSTANCE_MODIFIERS);
stmt.AddValue(0, GetGUID().GetCounter()); stmt.AddValue(0, GetGUID().GetCounter());
stmt.AddValue(1, GetModifier(ItemModifier.ScalingStatDistributionFixedLevel)); stmt.AddValue(1, GetModifier(ItemModifier.TimewalkerLevel));
stmt.AddValue(2, GetModifier(ItemModifier.ArtifactKnowledgeLevel)); stmt.AddValue(2, GetModifier(ItemModifier.ArtifactKnowledgeLevel));
trans.Append(stmt); trans.Append(stmt);
} }
@@ -438,30 +437,14 @@ namespace Game.Entities
SetCreatePlayedTime(fields.Read<uint>(11)); SetCreatePlayedTime(fields.Read<uint>(11));
SetText(fields.Read<string>(12)); SetText(fields.Read<string>(12));
uint upgradeId = fields.Read<uint>(13); SetModifier(ItemModifier.BattlePetSpeciesId, fields.Read<uint>(13));
ItemUpgradeRecord rulesetUpgrade = CliDB.ItemUpgradeStorage.LookupByKey(Global.DB2Mgr.GetRulesetItemUpgrade(entry)); SetModifier(ItemModifier.BattlePetBreedData, fields.Read<uint>(14));
ItemUpgradeRecord upgrade = CliDB.ItemUpgradeStorage.LookupByKey(upgradeId); SetModifier(ItemModifier.BattlePetLevel, fields.Read<ushort>(14));
if (rulesetUpgrade == null || upgrade == null || rulesetUpgrade.ItemUpgradePathID != upgrade.ItemUpgradePathID) SetModifier(ItemModifier.BattlePetDisplayId, fields.Read<uint>(16));
{
upgradeId = 0;
need_save = true;
}
if (rulesetUpgrade != null && upgradeId == 0) SetContext(fields.Read<byte>(17));
{
upgradeId = rulesetUpgrade.Id;
need_save = true;
}
SetModifier(ItemModifier.UpgradeId, upgradeId); var bonusListString = new StringArray(fields.Read<string>(18), ' ');
SetModifier(ItemModifier.BattlePetSpeciesId, fields.Read<uint>(14));
SetModifier(ItemModifier.BattlePetBreedData, fields.Read<uint>(15));
SetModifier(ItemModifier.BattlePetLevel, fields.Read<ushort>(16));
SetModifier(ItemModifier.BattlePetDisplayId, fields.Read<uint>(17));
SetContext(fields.Read<byte>(18));
var bonusListString = new StringArray(fields.Read<string>(19), ' ');
List<uint> bonusListIDs = new List<uint>(); List<uint> bonusListIDs = new List<uint>();
for (var i = 0; i < bonusListString.Length; ++i) for (var i = 0; i < bonusListString.Length; ++i)
{ {
@@ -470,25 +453,25 @@ namespace Game.Entities
} }
SetBonuses(bonusListIDs); SetBonuses(bonusListIDs);
SetModifier(ItemModifier.TransmogAppearanceAllSpecs, fields.Read<uint>(20)); SetModifier(ItemModifier.TransmogAppearanceAllSpecs, fields.Read<uint>(19));
SetModifier(ItemModifier.TransmogAppearanceSpec1, fields.Read<uint>(21)); SetModifier(ItemModifier.TransmogAppearanceSpec1, fields.Read<uint>(20));
SetModifier(ItemModifier.TransmogAppearanceSpec2, fields.Read<uint>(22)); SetModifier(ItemModifier.TransmogAppearanceSpec2, fields.Read<uint>(21));
SetModifier(ItemModifier.TransmogAppearanceSpec3, fields.Read<uint>(23)); SetModifier(ItemModifier.TransmogAppearanceSpec3, fields.Read<uint>(22));
SetModifier(ItemModifier.TransmogAppearanceSpec4, fields.Read<uint>(24)); SetModifier(ItemModifier.TransmogAppearanceSpec4, fields.Read<uint>(23));
SetModifier(ItemModifier.EnchantIllusionAllSpecs, fields.Read<uint>(25)); SetModifier(ItemModifier.EnchantIllusionAllSpecs, fields.Read<uint>(24));
SetModifier(ItemModifier.EnchantIllusionSpec1, fields.Read<uint>(26)); SetModifier(ItemModifier.EnchantIllusionSpec1, fields.Read<uint>(25));
SetModifier(ItemModifier.EnchantIllusionSpec2, fields.Read<uint>(27)); SetModifier(ItemModifier.EnchantIllusionSpec2, fields.Read<uint>(26));
SetModifier(ItemModifier.EnchantIllusionSpec3, fields.Read<uint>(28)); SetModifier(ItemModifier.EnchantIllusionSpec3, fields.Read<uint>(27));
SetModifier(ItemModifier.EnchantIllusionSpec4, fields.Read<uint>(29)); SetModifier(ItemModifier.EnchantIllusionSpec4, fields.Read<uint>(28));
int gemFields = 4; int gemFields = 4;
ItemDynamicFieldGems[] gemData = new ItemDynamicFieldGems[ItemConst.MaxGemSockets]; ItemDynamicFieldGems[] gemData = new ItemDynamicFieldGems[ItemConst.MaxGemSockets];
for (int i = 0; i < ItemConst.MaxGemSockets; ++i) for (int i = 0; i < ItemConst.MaxGemSockets; ++i)
{ {
gemData[i] = new ItemDynamicFieldGems(); gemData[i] = new ItemDynamicFieldGems();
gemData[i].ItemId = fields.Read<uint>(30 + i * gemFields); gemData[i].ItemId = fields.Read<uint>(29 + i * gemFields);
var gemBonusListIDs = new StringArray(fields.Read<string>(31 + i * gemFields), ' '); var gemBonusListIDs = new StringArray(fields.Read<string>(30 + i * gemFields), ' ');
if (!gemBonusListIDs.IsEmpty()) if (!gemBonusListIDs.IsEmpty())
{ {
uint b = 0; uint b = 0;
@@ -499,13 +482,13 @@ namespace Game.Entities
} }
} }
gemData[i].Context = fields.Read<byte>(32 + i * gemFields); gemData[i].Context = fields.Read<byte>(31 + i * gemFields);
if (gemData[i].ItemId != 0) if (gemData[i].ItemId != 0)
SetGem((ushort)i, gemData[i], fields.Read<uint>(33 + i * gemFields)); SetGem((ushort)i, gemData[i], fields.Read<uint>(32 + i * gemFields));
} }
SetModifier(ItemModifier.ScalingStatDistributionFixedLevel, fields.Read<uint>(42)); SetModifier(ItemModifier.TimewalkerLevel, fields.Read<uint>(41));
SetModifier(ItemModifier.ArtifactKnowledgeLevel, fields.Read<uint>(43)); SetModifier(ItemModifier.ArtifactKnowledgeLevel, fields.Read<uint>(42));
// Enchants must be loaded after all other bonus/scaling data // Enchants must be loaded after all other bonus/scaling data
var enchantmentTokens = new StringArray(fields.Read<string>(8), ' '); var enchantmentTokens = new StringArray(fields.Read<string>(8), ' ');
@@ -536,7 +519,6 @@ namespace Game.Entities
stmt.AddValue(index++, (uint)m_itemData.Expiration); stmt.AddValue(index++, (uint)m_itemData.Expiration);
stmt.AddValue(index++, (uint)m_itemData.DynamicFlags); stmt.AddValue(index++, (uint)m_itemData.DynamicFlags);
stmt.AddValue(index++, (uint)m_itemData.Durability); stmt.AddValue(index++, (uint)m_itemData.Durability);
stmt.AddValue(index++, GetModifier(ItemModifier.UpgradeId));
stmt.AddValue(index++, guid); stmt.AddValue(index++, guid);
DB.Characters.Execute(stmt); DB.Characters.Execute(stmt);
} }
@@ -1104,7 +1086,8 @@ namespace Game.Entities
public bool IsLimitedToAnotherMapOrZone(uint cur_mapId, uint cur_zoneId) public bool IsLimitedToAnotherMapOrZone(uint cur_mapId, uint cur_zoneId)
{ {
ItemTemplate proto = GetTemplate(); ItemTemplate proto = GetTemplate();
return proto != null && ((proto.GetMap() != 0 && proto.GetMap() != cur_mapId) || (proto.GetArea() != 0 && proto.GetArea() != cur_zoneId)); return proto != null && ((proto.GetMap() != 0 && proto.GetMap() != cur_mapId) ||
((proto.GetArea(0) != 0 && proto.GetArea(0) != cur_zoneId) && (proto.GetArea(1) != 0 && proto.GetArea(1) != cur_zoneId)));
} }
public void SendUpdateSockets() public void SendUpdateSockets()
@@ -1892,12 +1875,11 @@ namespace Game.Entities
uint minItemLevelCutoff = owner.m_unitData.MinItemLevelCutoff; uint minItemLevelCutoff = owner.m_unitData.MinItemLevelCutoff;
uint maxItemLevel = GetTemplate().GetFlags3().HasAnyFlag(ItemFlags3.IgnoreItemLevelCapInPvp) ? 0u : owner.m_unitData.MaxItemLevel; uint maxItemLevel = GetTemplate().GetFlags3().HasAnyFlag(ItemFlags3.IgnoreItemLevelCapInPvp) ? 0u : owner.m_unitData.MaxItemLevel;
bool pvpBonus = owner.IsUsingPvpItemLevels(); bool pvpBonus = owner.IsUsingPvpItemLevels();
return GetItemLevel(GetTemplate(), _bonusData, owner.GetLevel(), GetModifier(ItemModifier.ScalingStatDistributionFixedLevel), GetModifier(ItemModifier.UpgradeId), return GetItemLevel(GetTemplate(), _bonusData, owner.GetLevel(), GetModifier(ItemModifier.TimewalkerLevel),
minItemLevel, minItemLevelCutoff, maxItemLevel, pvpBonus); minItemLevel, minItemLevelCutoff, maxItemLevel, pvpBonus);
} }
public static uint GetItemLevel(ItemTemplate itemTemplate, BonusData bonusData, uint level, uint fixedLevel, uint upgradeId, public static uint GetItemLevel(ItemTemplate itemTemplate, BonusData bonusData, uint level, uint fixedLevel, uint minItemLevel, uint minItemLevelCutoff, uint maxItemLevel, bool pvpBonus)
uint minItemLevel, uint minItemLevelCutoff, uint maxItemLevel, bool pvpBonus)
{ {
if (itemTemplate == null) if (itemTemplate == null)
return 1; return 1;
@@ -1927,9 +1909,6 @@ namespace Game.Entities
itemLevel += bonusData.GemItemLevelBonus[i]; itemLevel += bonusData.GemItemLevelBonus[i];
uint itemLevelBeforeUpgrades = itemLevel; uint itemLevelBeforeUpgrades = itemLevel;
ItemUpgradeRecord upgrade = CliDB.ItemUpgradeStorage.LookupByKey(upgradeId);
if (upgrade != null)
itemLevel += upgrade.ItemLevelIncrement;
if (pvpBonus) if (pvpBonus)
itemLevel += Global.DB2Mgr.GetPvpItemLevelBonus(itemTemplate.GetId()); itemLevel += Global.DB2Mgr.GetPvpItemLevelBonus(itemTemplate.GetId());
@@ -1974,7 +1953,7 @@ namespace Game.Entities
if (itemTemplate.GetFlags().HasAnyFlag(ItemFlags.Conjured | ItemFlags.NoDisenchant) || itemTemplate.GetBonding() == ItemBondingType.Quest) if (itemTemplate.GetFlags().HasAnyFlag(ItemFlags.Conjured | ItemFlags.NoDisenchant) || itemTemplate.GetBonding() == ItemBondingType.Quest)
return null; return null;
if (itemTemplate.GetArea() != 0 || itemTemplate.GetMap() != 0 || itemTemplate.GetMaxStackSize() > 1) if (itemTemplate.GetArea(0) != 0 || itemTemplate.GetArea(1) != 0 || itemTemplate.GetMap() != 0 || itemTemplate.GetMaxStackSize() > 1)
return null; return null;
if (GetSellPrice(itemTemplate, quality, itemLevel) == 0 && !Global.DB2Mgr.HasItemCurrencyCost(itemTemplate.GetId())) if (GetSellPrice(itemTemplate, quality, itemLevel) == 0 && !Global.DB2Mgr.HasItemCurrencyCost(itemTemplate.GetId()))
@@ -2380,7 +2359,7 @@ namespace Game.Entities
public void SetFixedLevel(uint level) public void SetFixedLevel(uint level)
{ {
if (!_bonusData.HasFixedLevel || GetModifier(ItemModifier.ScalingStatDistributionFixedLevel) != 0) if (!_bonusData.HasFixedLevel || GetModifier(ItemModifier.TimewalkerLevel) != 0)
return; return;
ScalingStatDistributionRecord ssd = CliDB.ScalingStatDistributionStorage.LookupByKey(_bonusData.ScalingStatDistribution); ScalingStatDistributionRecord ssd = CliDB.ScalingStatDistributionStorage.LookupByKey(_bonusData.ScalingStatDistribution);
@@ -2393,7 +2372,7 @@ namespace Game.Entities
if ((contentTuning.Flags.HasAnyFlag(2) || contentTuning.MinLevel != 0 || contentTuning.MaxLevel != 0) && !contentTuning.Flags.HasAnyFlag(4)) if ((contentTuning.Flags.HasAnyFlag(2) || contentTuning.MinLevel != 0 || contentTuning.MaxLevel != 0) && !contentTuning.Flags.HasAnyFlag(4))
level = (uint)Math.Min(Math.Max(level, contentTuning.MinLevel), contentTuning.MaxLevel); level = (uint)Math.Min(Math.Max(level, contentTuning.MinLevel), contentTuning.MaxLevel);
SetModifier(ItemModifier.ScalingStatDistributionFixedLevel, level); SetModifier(ItemModifier.TimewalkerLevel, level);
} }
} }
@@ -2402,7 +2381,7 @@ namespace Game.Entities
if (_bonusData.RequiredLevelOverride != 0) if (_bonusData.RequiredLevelOverride != 0)
return _bonusData.RequiredLevelOverride; return _bonusData.RequiredLevelOverride;
else if (_bonusData.HasFixedLevel) else if (_bonusData.HasFixedLevel)
return (int)GetModifier(ItemModifier.ScalingStatDistributionFixedLevel); return (int)GetModifier(ItemModifier.TimewalkerLevel);
else else
return _bonusData.RequiredLevel; return _bonusData.RequiredLevel;
} }
+5 -5
View File
@@ -30,9 +30,9 @@ namespace Game.Entities
BasicData = item; BasicData = item;
ExtendedData = sparse; ExtendedData = sparse;
Specializations[0] = new BitArray((int)Class.Max * PlayerConst.MaxSpecializations); Specializations[0] = new BitSet((int)Class.Max * PlayerConst.MaxSpecializations);
Specializations[1] = new BitArray((int)Class.Max * PlayerConst.MaxSpecializations); Specializations[1] = new BitSet((int)Class.Max * PlayerConst.MaxSpecializations);
Specializations[2] = new BitArray((int)Class.Max * PlayerConst.MaxSpecializations); Specializations[2] = new BitSet((int)Class.Max * PlayerConst.MaxSpecializations);
} }
public string GetName(LocaleConstant locale = SharedConst.DefaultLocale) public string GetName(LocaleConstant locale = SharedConst.DefaultLocale)
@@ -296,7 +296,7 @@ namespace Game.Entities
public uint GetStartQuest() { return ExtendedData.StartQuestID; } public uint GetStartQuest() { return ExtendedData.StartQuestID; }
public uint GetLockID() { return ExtendedData.LockID; } public uint GetLockID() { return ExtendedData.LockID; }
public uint GetItemSet() { return ExtendedData.ItemSet; } public uint GetItemSet() { return ExtendedData.ItemSet; }
public uint GetArea() { return ExtendedData.ZoneBound; } public uint GetArea(int index) { return ExtendedData.ZoneBound[index]; }
public uint GetMap() { return ExtendedData.InstanceBound; } public uint GetMap() { return ExtendedData.InstanceBound; }
public BagFamilyMask GetBagFamily() { return (BagFamilyMask)ExtendedData.BagFamily; } public BagFamilyMask GetBagFamily() { return (BagFamilyMask)ExtendedData.BagFamily; }
public uint GetTotemCategory() { return ExtendedData.TotemCategoryID; } public uint GetTotemCategory() { return ExtendedData.TotemCategoryID; }
@@ -344,7 +344,7 @@ namespace Game.Entities
public ItemFlagsCustom FlagsCu; public ItemFlagsCustom FlagsCu;
public float SpellPPMRate; public float SpellPPMRate;
public uint RandomBonusListTemplateId; public uint RandomBonusListTemplateId;
public BitArray[] Specializations = new BitArray[3]; public BitSet[] Specializations = new BitSet[3];
public uint ItemSpecClassMask; public uint ItemSpecClassMask;
protected ItemRecord BasicData; protected ItemRecord BasicData;
@@ -2326,9 +2326,9 @@ namespace Game.Entities
} }
if (fieldVisibilityFlags.HasFlag(UpdateFieldFlag.PartyMember)) if (fieldVisibilityFlags.HasFlag(UpdateFieldFlag.PartyMember))
{ {
data.WriteBit(HasQuestSession); data.WriteBit((bool)HasQuestSession);
} }
data.WriteBit(HasLevelLink); data.WriteBit((bool)HasLevelLink);
data.FlushBits(); data.FlushBits();
} }
public override void WriteUpdate(WorldPacket data, UpdateFieldFlag fieldVisibilityFlags, Player owner, Player receiver) public override void WriteUpdate(WorldPacket data, UpdateFieldFlag fieldVisibilityFlags, Player owner, Player receiver)
+13 -16
View File
@@ -92,9 +92,9 @@ namespace Game.Entities
if (item.GetTemplate().GetArtifactID() != 0 && artifactDataPair != null) if (item.GetTemplate().GetArtifactID() != 0 && artifactDataPair != null)
item.LoadArtifactData(this, artifactDataPair.Item1, artifactDataPair.Item2, artifactDataPair.Item3, artifactDataPair.Item4); item.LoadArtifactData(this, artifactDataPair.Item1, artifactDataPair.Item2, artifactDataPair.Item3, artifactDataPair.Item4);
ulong counter = result.Read<ulong>(44); ulong counter = result.Read<ulong>(43);
ObjectGuid bagGuid = counter != 0 ? ObjectGuid.Create(HighGuid.Item, counter) : ObjectGuid.Empty; ObjectGuid bagGuid = counter != 0 ? ObjectGuid.Create(HighGuid.Item, counter) : ObjectGuid.Empty;
byte slot = result.Read<byte>(45); byte slot = result.Read<byte>(44);
GetSession().GetCollectionMgr().CheckHeirloomUpgrades(item); GetSession().GetCollectionMgr().CheckHeirloomUpgrades(item);
GetSession().GetCollectionMgr().AddItemAppearance(item); GetSession().GetCollectionMgr().AddItemAppearance(item);
@@ -1100,18 +1100,17 @@ namespace Game.Entities
do do
{ {
// SELECT itemId, itemEntry, slot, creatorGuid, randomBonusListId, upgradeId, fixedScalingLevel, artifactKnowledgeLevel, context, bonusListIDs FROM character_void_storage WHERE playerGuid = ? // SELECT itemId, itemEntry, slot, creatorGuid, randomBonusListId, fixedScalingLevel, artifactKnowledgeLevel, context, bonusListIDs FROM character_void_storage WHERE playerGuid = ?
ulong itemId = result.Read<ulong>(0); ulong itemId = result.Read<ulong>(0);
uint itemEntry = result.Read<uint>(1); uint itemEntry = result.Read<uint>(1);
byte slot = result.Read<byte>(2); byte slot = result.Read<byte>(2);
ObjectGuid creatorGuid = result.Read<ulong>(3) != 0 ? ObjectGuid.Create(HighGuid.Player, result.Read<ulong>(3)) : ObjectGuid.Empty; ObjectGuid creatorGuid = result.Read<ulong>(3) != 0 ? ObjectGuid.Create(HighGuid.Player, result.Read<ulong>(3)) : ObjectGuid.Empty;
uint randomBonusListId = result.Read<uint>(4); uint randomBonusListId = result.Read<uint>(4);
uint upgradeId = result.Read<uint>(5); uint fixedScalingLevel = result.Read<uint>(5);
uint fixedScalingLevel = result.Read<uint>(6); uint artifactKnowledgeLevel = result.Read<uint>(6);
uint artifactKnowledgeLevel = result.Read<uint>(7); byte context = result.Read<byte>(7);
byte context = result.Read<byte>(8);
List<uint> bonusListIDs = new List<uint>(); List<uint> bonusListIDs = new List<uint>();
var bonusListIdTokens = new StringArray(result.Read<string>(9), ' '); var bonusListIdTokens = new StringArray(result.Read<string>(8), ' ');
for (var i = 0; i < bonusListIdTokens.Length; ++i) for (var i = 0; i < bonusListIdTokens.Length; ++i)
{ {
if (uint.TryParse(bonusListIdTokens[i], out uint id)) if (uint.TryParse(bonusListIdTokens[i], out uint id))
@@ -1136,10 +1135,9 @@ namespace Game.Entities
continue; continue;
} }
_voidStorageItems[slot] = new VoidStorageItem(itemId, itemEntry, creatorGuid, randomBonusListId, upgradeId, fixedScalingLevel, artifactKnowledgeLevel, context, bonusListIDs); _voidStorageItems[slot] = new VoidStorageItem(itemId, itemEntry, creatorGuid, randomBonusListId, fixedScalingLevel, artifactKnowledgeLevel, context, bonusListIDs);
BonusData bonus = new BonusData(new ItemInstance(_voidStorageItems[slot])); BonusData bonus = new BonusData(new ItemInstance(_voidStorageItems[slot]));
GetSession().GetCollectionMgr().AddItemAppearance(itemEntry, bonus.AppearanceModID); GetSession().GetCollectionMgr().AddItemAppearance(itemEntry, bonus.AppearanceModID);
} }
while (result.NextRow()); while (result.NextRow());
@@ -1230,7 +1228,7 @@ namespace Game.Entities
} }
Item item = Bag.NewItemOrBag(proto); Item item = Bag.NewItemOrBag(proto);
ObjectGuid ownerGuid = result.Read<ulong>(44) != 0 ? ObjectGuid.Create(HighGuid.Player, result.Read<ulong>(44)) : ObjectGuid.Empty; ObjectGuid ownerGuid = result.Read<ulong>(43) != 0 ? ObjectGuid.Create(HighGuid.Player, result.Read<ulong>(43)) : ObjectGuid.Empty;
if (!item.LoadFromDB(itemGuid, ownerGuid, result.GetFields(), itemEntry)) if (!item.LoadFromDB(itemGuid, ownerGuid, result.GetFields(), itemEntry))
{ {
Log.outError(LogFilter.Player, "Player:_LoadMailedItems - Item in mail ({0}) doesn't exist !!!! - item guid: {1}, deleted from mail", mail.messageID, itemGuid); Log.outError(LogFilter.Player, "Player:_LoadMailedItems - Item in mail ({0}) doesn't exist !!!! - item guid: {1}, deleted from mail", mail.messageID, itemGuid);
@@ -2249,15 +2247,14 @@ namespace Game.Entities
stmt.AddValue(3, i); stmt.AddValue(3, i);
stmt.AddValue(4, _voidStorageItems[i].CreatorGuid.GetCounter()); stmt.AddValue(4, _voidStorageItems[i].CreatorGuid.GetCounter());
stmt.AddValue(5, (byte)_voidStorageItems[i].RandomBonusListId); stmt.AddValue(5, (byte)_voidStorageItems[i].RandomBonusListId);
stmt.AddValue(6, _voidStorageItems[i].ItemUpgradeId); stmt.AddValue(6, _voidStorageItems[i].FixedScalingLevel);
stmt.AddValue(7, _voidStorageItems[i].FixedScalingLevel); stmt.AddValue(7, _voidStorageItems[i].ArtifactKnowledgeLevel);
stmt.AddValue(8, _voidStorageItems[i].ArtifactKnowledgeLevel); stmt.AddValue(8, _voidStorageItems[i].Context);
stmt.AddValue(9, _voidStorageItems[i].Context);
StringBuilder bonusListIDs = new StringBuilder(); StringBuilder bonusListIDs = new StringBuilder();
foreach (uint bonusListID in _voidStorageItems[i].BonusListIDs) foreach (uint bonusListID in _voidStorageItems[i].BonusListIDs)
bonusListIDs.AppendFormat("{0} ", bonusListID); bonusListIDs.AppendFormat("{0} ", bonusListID);
stmt.AddValue(10, bonusListIDs.ToString()); stmt.AddValue(9, bonusListIDs.ToString());
} }
trans.Append(stmt); trans.Append(stmt);
+5 -7
View File
@@ -446,13 +446,12 @@ namespace Game.Entities
public class VoidStorageItem public class VoidStorageItem
{ {
public VoidStorageItem(ulong id, uint entry, ObjectGuid creator, uint randomBonusListId, uint upgradeId, uint fixedScalingLevel, uint artifactKnowledgeLevel, byte context, List<uint> bonuses) public VoidStorageItem(ulong id, uint entry, ObjectGuid creator, uint randomBonusListId, uint fixedScalingLevel, uint artifactKnowledgeLevel, byte context, List<uint> bonuses)
{ {
ItemId = id; ItemId = id;
ItemEntry = entry; ItemEntry = entry;
CreatorGuid = creator; CreatorGuid = creator;
RandomBonusListId = randomBonusListId; RandomBonusListId = randomBonusListId;
ItemUpgradeId = upgradeId;
FixedScalingLevel = fixedScalingLevel; FixedScalingLevel = fixedScalingLevel;
ArtifactKnowledgeLevel = artifactKnowledgeLevel; ArtifactKnowledgeLevel = artifactKnowledgeLevel;
Context = context; Context = context;
@@ -465,7 +464,6 @@ namespace Game.Entities
public uint ItemEntry; public uint ItemEntry;
public ObjectGuid CreatorGuid; public ObjectGuid CreatorGuid;
public uint RandomBonusListId; public uint RandomBonusListId;
public uint ItemUpgradeId;
public uint FixedScalingLevel; public uint FixedScalingLevel;
public uint ArtifactKnowledgeLevel; public uint ArtifactKnowledgeLevel;
public byte Context; public byte Context;
@@ -545,14 +543,14 @@ namespace Game.Entities
{ {
public CUFProfile() public CUFProfile()
{ {
BoolOptions = new BitArray((int)CUFBoolOptions.BoolOptionsCount); BoolOptions = new BitSet((int)CUFBoolOptions.BoolOptionsCount);
} }
public CUFProfile(string name, ushort frameHeight, ushort frameWidth, byte sortBy, byte healthText, uint boolOptions, public CUFProfile(string name, ushort frameHeight, ushort frameWidth, byte sortBy, byte healthText, uint boolOptions,
byte topPoint, byte bottomPoint, byte leftPoint, ushort topOffset, ushort bottomOffset, ushort leftOffset) byte topPoint, byte bottomPoint, byte leftPoint, ushort topOffset, ushort bottomOffset, ushort leftOffset)
{ {
ProfileName = name; ProfileName = name;
BoolOptions = new BitArray(new int[] { (int)boolOptions }); BoolOptions = new BitSet(new uint[] { boolOptions });
FrameHeight = frameHeight; FrameHeight = frameHeight;
FrameWidth = frameWidth; FrameWidth = frameWidth;
@@ -576,7 +574,7 @@ namespace Game.Entities
} }
public ulong GetUlongOptionValue() public ulong GetUlongOptionValue()
{ {
int[] array = new int[1]; uint[] array = new uint[1];
BoolOptions.CopyTo(array, 0); BoolOptions.CopyTo(array, 0);
return (ulong)array[0]; return (ulong)array[0];
} }
@@ -597,7 +595,7 @@ namespace Game.Entities
public ushort BottomOffset; public ushort BottomOffset;
public ushort LeftOffset; public ushort LeftOffset;
public BitArray BoolOptions; public BitSet BoolOptions;
// More fields can be added to BoolOptions without changing DB schema (up to 32, currently 27) // More fields can be added to BoolOptions without changing DB schema (up to 32, currently 27)
} }
@@ -1275,10 +1275,6 @@ namespace Game.Entities
item.AddItemFlag(ItemFieldFlags.NewItem); item.AddItemFlag(ItemFieldFlags.NewItem);
uint upgradeID = Global.DB2Mgr.GetRulesetItemUpgrade(itemId);
if (upgradeID != 0)
item.SetModifier(ItemModifier.UpgradeId, upgradeID);
item.SetContext(context); item.SetContext(context);
item.SetBonuses(bonusListIDs); item.SetBonuses(bonusListIDs);
+2 -2
View File
@@ -695,9 +695,9 @@ namespace Game.Entities
// If map is dungeon find linked graveyard // If map is dungeon find linked graveyard
if (GetMap().IsDungeon()) if (GetMap().IsDungeon())
{ {
WorldSafeLocsRecord entry = Global.ObjectMgr.GetClosestGraveYard(this, GetTeam(), this); WorldSafeLocsEntry entry = Global.ObjectMgr.GetClosestGraveYard(this, GetTeam(), this);
if (entry != null) if (entry != null)
m_bgData.joinPos = new WorldLocation(entry.MapID, entry.Loc.X, entry.Loc.Y, entry.Loc.Z, 0.0f); m_bgData.joinPos = entry.Loc;
else else
Log.outError(LogFilter.Player, "SetBattlegroundEntryPoint: Dungeon map {0} has no linked graveyard, setting home location as entry point.", GetMapId()); Log.outError(LogFilter.Player, "SetBattlegroundEntryPoint: Dungeon map {0} has no linked graveyard, setting home location as entry point.", GetMapId());
} }
+3 -3
View File
@@ -4666,7 +4666,7 @@ namespace Game.Entities
SpawnCorpseBones(); SpawnCorpseBones();
} }
WorldSafeLocsRecord ClosestGrave = null; WorldSafeLocsEntry ClosestGrave = null;
// Special handle for Battlegroundmaps // Special handle for Battlegroundmaps
Battleground bg = GetBattleground(); Battleground bg = GetBattleground();
@@ -4688,11 +4688,11 @@ namespace Game.Entities
// and don't show spirit healer location // and don't show spirit healer location
if (ClosestGrave != null) if (ClosestGrave != null)
{ {
TeleportTo(ClosestGrave.MapID, ClosestGrave.Loc.X, ClosestGrave.Loc.Y, ClosestGrave.Loc.Z, (ClosestGrave.Facing * MathFunctions.PI) / 180); TeleportTo(ClosestGrave.Loc);
if (IsDead()) // not send if alive, because it used in TeleportTo() if (IsDead()) // not send if alive, because it used in TeleportTo()
{ {
DeathReleaseLoc packet = new DeathReleaseLoc(); DeathReleaseLoc packet = new DeathReleaseLoc();
packet.MapID = (int)ClosestGrave.MapID; packet.MapID = (int)ClosestGrave.Loc.GetMapId();
packet.Loc = ClosestGrave.Loc; packet.Loc = ClosestGrave.Loc;
SendPacket(packet); SendPacket(packet);
} }
+66 -21
View File
@@ -746,7 +746,7 @@ namespace Game
uint zoneId = result.Read<uint>(1); uint zoneId = result.Read<uint>(1);
Team team = (Team)result.Read<uint>(2); Team team = (Team)result.Read<uint>(2);
WorldSafeLocsRecord entry = CliDB.WorldSafeLocsStorage.LookupByKey(safeLocId); WorldSafeLocsEntry entry = GetWorldSafeLoc(safeLocId);
if (entry == null) if (entry == null)
{ {
Log.outError(LogFilter.Sql, "Table `graveyard_zone` has a record for not existing graveyard (WorldSafeLocs.dbc id) {0}, skipped.", safeLocId); Log.outError(LogFilter.Sql, "Table `graveyard_zone` has a record for not existing graveyard (WorldSafeLocs.dbc id) {0}, skipped.", safeLocId);
@@ -772,16 +772,46 @@ namespace Game
Log.outInfo(LogFilter.ServerLoading, "Loaded {0} graveyard-zone links in {1} ms", count, Time.GetMSTimeDiffToNow(oldMSTime)); Log.outInfo(LogFilter.ServerLoading, "Loaded {0} graveyard-zone links in {1} ms", count, Time.GetMSTimeDiffToNow(oldMSTime));
} }
public void LoadWorldSafeLocs()
{
uint oldMSTime = Time.GetMSTime();
WorldSafeLocsRecord GetDefaultGraveYard(Team team) // 0 1 2 3 4 5
SQLResult result = DB.World.Query("SELECT ID, MapID, LocX, LocY, LocZ, Facing FROM world_safe_locs");
if (result.IsEmpty())
{
Log.outInfo(LogFilter.ServerLoading, "Loaded 0 world locations. DB table `world_safe_locs` is empty.");
return;
}
do
{
uint id = result.Read<uint>(0);
WorldLocation loc = new WorldLocation(result.Read<uint>(1), result.Read<float>(2), result.Read<float>(3), result.Read<float>(4), result.Read<float>(5));
if (!GridDefines.IsValidMapCoord(loc))
{
Log.outError(LogFilter.Sql, $"World location (ID: {id}) has a invalid position MapID: {loc.GetMapId()} {loc.ToString()}, skipped");
continue;
}
WorldSafeLocsEntry worldSafeLocs = new WorldSafeLocsEntry();
worldSafeLocs.Id = id;
worldSafeLocs.Loc = loc;
_worldSafeLocs[id] = worldSafeLocs;
} while (result.NextRow());
Log.outInfo(LogFilter.ServerLoading, $"Loaded {_worldSafeLocs.Count} world locations {Time.GetMSTimeDiffToNow(oldMSTime)} ms");
}
WorldSafeLocsEntry GetDefaultGraveYard(Team team)
{ {
if (team == Team.Horde) if (team == Team.Horde)
return CliDB.WorldSafeLocsStorage.LookupByKey(10); return GetWorldSafeLoc(10);
else if (team == Team.Alliance) else if (team == Team.Alliance)
return CliDB.WorldSafeLocsStorage.LookupByKey(4); return GetWorldSafeLoc(4);
else return null; else return null;
} }
public WorldSafeLocsRecord GetClosestGraveYard(WorldLocation location, Team team, WorldObject conditionObject) public WorldSafeLocsEntry GetClosestGraveYard(WorldLocation location, Team team, WorldObject conditionObject)
{ {
float x, y, z; float x, y, z;
location.GetPosition(out x, out y, out z); location.GetPosition(out x, out y, out z);
@@ -821,19 +851,19 @@ namespace Game
// at corpse map // at corpse map
bool foundNear = false; bool foundNear = false;
float distNear = 10000; float distNear = 10000;
WorldSafeLocsRecord entryNear = null; WorldSafeLocsEntry entryNear = null;
// at entrance map for corpse map // at entrance map for corpse map
bool foundEntr = false; bool foundEntr = false;
float distEntr = 10000; float distEntr = 10000;
WorldSafeLocsRecord entryEntr = null; WorldSafeLocsEntry entryEntr = null;
// some where other // some where other
WorldSafeLocsRecord entryFar = null; WorldSafeLocsEntry entryFar = null;
foreach (var data in range) foreach (var data in range)
{ {
WorldSafeLocsRecord entry = CliDB.WorldSafeLocsStorage.LookupByKey(data.safeLocId); WorldSafeLocsEntry entry = GetWorldSafeLoc(data.safeLocId);
if (entry == null) if (entry == null)
{ {
Log.outError(LogFilter.Sql, "Table `game_graveyard_zone` has record for not existing graveyard (WorldSafeLocs.dbc id) {0}, skipped.", data.safeLocId); Log.outError(LogFilter.Sql, "Table `game_graveyard_zone` has record for not existing graveyard (WorldSafeLocs.dbc id) {0}, skipped.", data.safeLocId);
@@ -850,17 +880,17 @@ namespace Game
if (!Global.ConditionMgr.IsObjectMeetingNotGroupedConditions(ConditionSourceType.Graveyard, data.safeLocId, conditionSource)) if (!Global.ConditionMgr.IsObjectMeetingNotGroupedConditions(ConditionSourceType.Graveyard, data.safeLocId, conditionSource))
continue; continue;
if (entry.MapID == mapEntry.ParentMapID && !conditionObject.GetPhaseShift().HasVisibleMapId(entry.MapID)) if (entry.Loc.GetMapId() == mapEntry.ParentMapID && !conditionObject.GetPhaseShift().HasVisibleMapId(entry.Loc.GetMapId()))
continue; continue;
} }
// find now nearest graveyard at other map // find now nearest graveyard at other map
if (MapId != entry.MapID && entry.MapID != mapEntry.ParentMapID) if (MapId != entry.Loc.GetMapId() && entry.Loc.GetMapId() != mapEntry.ParentMapID)
{ {
// if find graveyard at different map from where entrance placed (or no entrance data), use any first // if find graveyard at different map from where entrance placed (or no entrance data), use any first
if (mapEntry == null if (mapEntry == null
|| mapEntry.CorpseMapID < 0 || mapEntry.CorpseMapID < 0
|| mapEntry.CorpseMapID != entry.MapID || mapEntry.CorpseMapID != entry.Loc.GetMapId()
|| (mapEntry.Corpse.X == 0 && mapEntry.Corpse.Y == 0)) || (mapEntry.Corpse.X == 0 && mapEntry.Corpse.Y == 0))
{ {
// not have any corrdinates for check distance anyway // not have any corrdinates for check distance anyway
@@ -869,8 +899,8 @@ namespace Game
} }
// at entrance map calculate distance (2D); // at entrance map calculate distance (2D);
float dist2 = (entry.Loc.X - mapEntry.Corpse.X) * (entry.Loc.X - mapEntry.Corpse.X) float dist2 = (entry.Loc.GetPositionX() - mapEntry.Corpse.X) * (entry.Loc.GetPositionX() - mapEntry.Corpse.X)
+ (entry.Loc.Y - mapEntry.Corpse.Y) * (entry.Loc.Y - mapEntry.Corpse.Y); + (entry.Loc.GetPositionY() - mapEntry.Corpse.Y) * (entry.Loc.GetPositionY() - mapEntry.Corpse.Y);
if (foundEntr) if (foundEntr)
{ {
if (dist2 < distEntr) if (dist2 < distEntr)
@@ -889,7 +919,7 @@ namespace Game
// find now nearest graveyard at same map // find now nearest graveyard at same map
else else
{ {
float dist2 = (entry.Loc.X - x) * (entry.Loc.X - x) + (entry.Loc.Y - y) * (entry.Loc.Y - y) + (entry.Loc.Z - z) * (entry.Loc.Z - z); float dist2 = (entry.Loc.GetPositionX() - x) * (entry.Loc.GetPositionX() - x) + (entry.Loc.GetPositionY() - y) * (entry.Loc.GetPositionY() - y) + (entry.Loc.GetPositionZ() - z) * (entry.Loc.GetPositionZ() - z);
if (foundNear) if (foundNear)
{ {
if (dist2 < distNear) if (dist2 < distNear)
@@ -925,6 +955,14 @@ namespace Game
} }
return null; return null;
} }
public WorldSafeLocsEntry GetWorldSafeLoc(uint id)
{
return _worldSafeLocs.LookupByKey(id);
}
public Dictionary<uint, WorldSafeLocsEntry> GetWorldSafeLocs()
{
return _worldSafeLocs;
}
public bool AddGraveYardLink(uint id, uint zoneId, Team team, bool persist = true) public bool AddGraveYardLink(uint id, uint zoneId, Team team, bool persist = true)
{ {
@@ -4985,7 +5023,7 @@ namespace Game
uint Trigger_ID = result.Read<uint>(0); uint Trigger_ID = result.Read<uint>(0);
uint PortLocID = result.Read<uint>(1); uint PortLocID = result.Read<uint>(1);
WorldSafeLocsRecord portLoc = CliDB.WorldSafeLocsStorage.LookupByKey(PortLocID); WorldSafeLocsEntry portLoc = GetWorldSafeLoc(PortLocID);
if (portLoc == null) if (portLoc == null)
{ {
Log.outError(LogFilter.Sql, "Area Trigger (ID: {0}) has a non-existing Port Loc (ID: {1}) in WorldSafeLocs.dbc, skipped", Trigger_ID, PortLocID); Log.outError(LogFilter.Sql, "Area Trigger (ID: {0}) has a non-existing Port Loc (ID: {1}) in WorldSafeLocs.dbc, skipped", Trigger_ID, PortLocID);
@@ -4993,11 +5031,11 @@ namespace Game
} }
AreaTriggerStruct at = new AreaTriggerStruct(); AreaTriggerStruct at = new AreaTriggerStruct();
at.target_mapId = portLoc.MapID; at.target_mapId = portLoc.Loc.GetMapId();
at.target_X = portLoc.Loc.X; at.target_X = portLoc.Loc.GetPositionX();
at.target_Y = portLoc.Loc.Y; at.target_Y = portLoc.Loc.GetPositionY();
at.target_Z = portLoc.Loc.Z; at.target_Z = portLoc.Loc.GetPositionZ();
at.target_Orientation = (portLoc.Facing * MathFunctions.PI) / 180; // Orientation is initially in degrees at.target_Orientation = portLoc.Loc.GetOrientation();
at.PortLocId = portLoc.Id; at.PortLocId = portLoc.Id;
AreaTriggerRecord atEntry = CliDB.AreaTriggerStorage.LookupByKey(Trigger_ID); AreaTriggerRecord atEntry = CliDB.AreaTriggerStorage.LookupByKey(Trigger_ID);
@@ -9773,6 +9811,7 @@ namespace Game
Dictionary<uint, AreaTriggerStruct> _areaTriggerStorage = new Dictionary<uint, AreaTriggerStruct>(); Dictionary<uint, AreaTriggerStruct> _areaTriggerStorage = new Dictionary<uint, AreaTriggerStruct>();
Dictionary<ulong, AccessRequirement> _accessRequirementStorage = new Dictionary<ulong, AccessRequirement>(); Dictionary<ulong, AccessRequirement> _accessRequirementStorage = new Dictionary<ulong, AccessRequirement>();
MultiMap<ulong, DungeonEncounter> _dungeonEncounterStorage = new MultiMap<ulong, DungeonEncounter>(); MultiMap<ulong, DungeonEncounter> _dungeonEncounterStorage = new MultiMap<ulong, DungeonEncounter>();
Dictionary<uint, WorldSafeLocsEntry> _worldSafeLocs = new Dictionary<uint, WorldSafeLocsEntry>();
Dictionary<HighGuid, ObjectGuidGenerator> _guidGenerators = new Dictionary<HighGuid, ObjectGuidGenerator>(); Dictionary<HighGuid, ObjectGuidGenerator> _guidGenerators = new Dictionary<HighGuid, ObjectGuidGenerator>();
// first free id for selected id type // first free id for selected id type
@@ -10150,6 +10189,12 @@ namespace Game
} }
} }
public class WorldSafeLocsEntry
{
public uint Id;
public WorldLocation Loc;
}
public class GraveYardData public class GraveYardData
{ {
public uint safeLocId; public uint safeLocId;
+1 -1
View File
@@ -2678,7 +2678,7 @@ namespace Game.Groups
BonusData bonusData = new BonusData(itemInstance); BonusData bonusData = new BonusData(itemInstance);
ItemTemplate itemTemplate = Global.ObjectMgr.GetItemTemplate(itemid); ItemTemplate itemTemplate = Global.ObjectMgr.GetItemTemplate(itemid);
uint itemLevel = Item.GetItemLevel(itemTemplate, bonusData, player.GetLevel(), 0, lootItemInSlot.upgradeId, 0, 0, 0, false); uint itemLevel = Item.GetItemLevel(itemTemplate, bonusData, player.GetLevel(), 0, 0, 0, 0, false);
return Item.GetDisenchantLoot(itemTemplate, (uint)bonusData.Quality, itemLevel); return Item.GetDisenchantLoot(itemTemplate, (uint)bonusData.Quality, itemLevel);
} }
+2 -2
View File
@@ -1315,7 +1315,7 @@ namespace Game.Guilds
public bool LoadBankItemFromDB(SQLFields field) public bool LoadBankItemFromDB(SQLFields field)
{ {
byte tabId = field.Read<byte>(45); byte tabId = field.Read<byte>(44);
if (tabId >= _GetPurchasedTabsSize()) if (tabId >= _GetPurchasedTabsSize())
{ {
Log.outError(LogFilter.Guild, "Invalid tab for item (GUID: {0}, id: {1}) in guild bank, skipped.", Log.outError(LogFilter.Guild, "Invalid tab for item (GUID: {0}, id: {1}) in guild bank, skipped.",
@@ -3218,7 +3218,7 @@ namespace Game.Guilds
public bool LoadItemFromDB(SQLFields field) public bool LoadItemFromDB(SQLFields field)
{ {
byte slotId = field.Read<byte>(46); byte slotId = field.Read<byte>(45);
uint itemGuid = field.Read<uint>(0); uint itemGuid = field.Read<uint>(0);
uint itemEntry = field.Read<uint>(1); uint itemEntry = field.Read<uint>(1);
if (slotId >= GuildConst.MaxBankSlots) if (slotId >= GuildConst.MaxBankSlots)
+3 -4
View File
@@ -339,10 +339,9 @@ namespace Game
// Delete orphaned guild bank tab entries before loading the valid ones // Delete orphaned guild bank tab entries before loading the valid ones
DB.Characters.DirectExecute("DELETE gbt FROM guild_bank_tab gbt LEFT JOIN guild g ON gbt.guildId = g.guildId WHERE g.guildId IS NULL"); DB.Characters.DirectExecute("DELETE gbt FROM guild_bank_tab gbt LEFT JOIN guild g ON gbt.guildId = g.guildId WHERE g.guildId IS NULL");
// 0 1 2 3 4 // 0 1 2 3 4
SQLResult result = DB.Characters.Query("SELECT guildid, TabId, TabName, TabIcon, TabText FROM guild_bank_tab ORDER BY guildid ASC, TabId ASC"); SQLResult result = DB.Characters.Query("SELECT guildid, TabId, TabName, TabIcon, TabText FROM guild_bank_tab ORDER BY guildid ASC, TabId ASC");
if (result.IsEmpty()) if (result.IsEmpty())
{ {
Log.outInfo(LogFilter.ServerLoading, "Loaded 0 guild bank tabs. DB table `guild_bank_tab` is empty."); Log.outInfo(LogFilter.ServerLoading, "Loaded 0 guild bank tabs. DB table `guild_bank_tab` is empty.");
@@ -383,7 +382,7 @@ namespace Game
uint count = 0; uint count = 0;
do do
{ {
ulong guildId = result.Read<ulong>(44); ulong guildId = result.Read<ulong>(43);
Guild guild = GetGuildById(guildId); Guild guild = GetGuildById(guildId);
if (guild) if (guild)
guild.LoadBankItemFromDB(result.GetFields()); guild.LoadBankItemFromDB(result.GetFields());
+1 -1
View File
@@ -935,7 +935,7 @@ namespace Game
if (gems[i]) if (gems[i])
{ {
uint gemScalingLevel = _player.GetLevel(); uint gemScalingLevel = _player.GetLevel();
uint fixedLevel = gems[i].GetModifier(ItemModifier.ScalingStatDistributionFixedLevel); uint fixedLevel = gems[i].GetModifier(ItemModifier.TimewalkerLevel);
if (fixedLevel != 0) if (fixedLevel != 0)
gemScalingLevel = fixedLevel; gemScalingLevel = fixedLevel;
+4 -4
View File
@@ -334,7 +334,7 @@ namespace Game
if (!teleported) if (!teleported)
{ {
WorldSafeLocsRecord entranceLocation = null; WorldSafeLocsEntry entranceLocation = null;
InstanceSave instanceSave = player.GetInstanceSave(at.target_mapId); InstanceSave instanceSave = player.GetInstanceSave(at.target_mapId);
if (instanceSave != null) if (instanceSave != null)
{ {
@@ -347,17 +347,17 @@ namespace Game
{ {
InstanceScript instanceScript = instanceMap.GetInstanceScript(); InstanceScript instanceScript = instanceMap.GetInstanceScript();
if (instanceScript != null) if (instanceScript != null)
entranceLocation = CliDB.WorldSafeLocsStorage.LookupByKey(instanceScript.GetEntranceLocation()); entranceLocation = Global.ObjectMgr.GetWorldSafeLoc(instanceScript.GetEntranceLocation());
} }
} }
// Finally check with the instancesave for an entrance location if we did not get a valid one from the instancescript // Finally check with the instancesave for an entrance location if we did not get a valid one from the instancescript
if (entranceLocation == null) if (entranceLocation == null)
entranceLocation = CliDB.WorldSafeLocsStorage.LookupByKey(instanceSave.GetEntranceLocation()); entranceLocation = Global.ObjectMgr.GetWorldSafeLoc(instanceSave.GetEntranceLocation());
} }
if (entranceLocation != null) if (entranceLocation != null)
player.TeleportTo(entranceLocation.MapID, entranceLocation.Loc.X, entranceLocation.Loc.Y, entranceLocation.Loc.Z, (float)(entranceLocation.Facing * Math.PI / 180), TeleportToOptions.NotLeaveTransport); player.TeleportTo(entranceLocation.Loc, TeleportToOptions.NotLeaveTransport);
else else
player.TeleportTo(at.target_mapId, at.target_X, at.target_Y, at.target_Z, at.target_Orientation, TeleportToOptions.NotLeaveTransport); player.TeleportTo(at.target_mapId, at.target_X, at.target_Y, at.target_Z, at.target_Orientation, TeleportToOptions.NotLeaveTransport);
} }
+3 -3
View File
@@ -273,7 +273,7 @@ namespace Game
GetPlayer().DurabilityLossAll(0.25f, true); GetPlayer().DurabilityLossAll(0.25f, true);
// get corpse nearest graveyard // get corpse nearest graveyard
WorldSafeLocsRecord corpseGrave = null; WorldSafeLocsEntry corpseGrave = null;
WorldLocation corpseLocation = GetPlayer().GetCorpseLocation(); WorldLocation corpseLocation = GetPlayer().GetCorpseLocation();
if (GetPlayer().HasCorpse()) if (GetPlayer().HasCorpse())
{ {
@@ -286,10 +286,10 @@ namespace Game
// teleport to nearest from corpse graveyard, if different from nearest to player ghost // teleport to nearest from corpse graveyard, if different from nearest to player ghost
if (corpseGrave != null) if (corpseGrave != null)
{ {
WorldSafeLocsRecord ghostGrave = Global.ObjectMgr.GetClosestGraveYard(GetPlayer(), GetPlayer().GetTeam(), GetPlayer()); WorldSafeLocsEntry ghostGrave = Global.ObjectMgr.GetClosestGraveYard(GetPlayer(), GetPlayer().GetTeam(), GetPlayer());
if (corpseGrave != ghostGrave) if (corpseGrave != ghostGrave)
GetPlayer().TeleportTo(corpseGrave.MapID, corpseGrave.Loc.X, corpseGrave.Loc.Y, corpseGrave.Loc.Z, GetPlayer().GetOrientation()); GetPlayer().TeleportTo(corpseGrave.Loc);
} }
} }
+1 -3
View File
@@ -156,8 +156,7 @@ namespace Game
} }
VoidStorageItem itemVS = new VoidStorageItem(Global.ObjectMgr.GenerateVoidStorageItemId(), item.GetEntry(), item.GetCreator(), VoidStorageItem itemVS = new VoidStorageItem(Global.ObjectMgr.GenerateVoidStorageItemId(), item.GetEntry(), item.GetCreator(),
item.GetItemRandomBonusListId(), item.GetModifier(ItemModifier.UpgradeId), item.GetItemRandomBonusListId(), item.GetModifier(ItemModifier.TimewalkerLevel), item.GetModifier(ItemModifier.ArtifactKnowledgeLevel),
item.GetModifier(ItemModifier.ScalingStatDistributionFixedLevel), item.GetModifier(ItemModifier.ArtifactKnowledgeLevel),
(byte)item.m_itemData.Context, item.m_itemData.BonusListIDs); (byte)item.m_itemData.Context, item.m_itemData.BonusListIDs);
VoidItem voidItem; VoidItem voidItem;
@@ -197,7 +196,6 @@ namespace Game
Item item = player.StoreNewItem(dest, itemVS.ItemEntry, true, itemVS.RandomBonusListId, null, itemVS.Context, itemVS.BonusListIDs); Item item = player.StoreNewItem(dest, itemVS.ItemEntry, true, itemVS.RandomBonusListId, null, itemVS.Context, itemVS.BonusListIDs);
item.SetCreator(itemVS.CreatorGuid); item.SetCreator(itemVS.CreatorGuid);
item.SetModifier(ItemModifier.UpgradeId, itemVS.ItemUpgradeId);
item.SetBinding(true); item.SetBinding(true);
GetCollectionMgr().AddItemAppearance(item); GetCollectionMgr().AddItemAppearance(item);
-2
View File
@@ -41,7 +41,6 @@ namespace Game.Loots
needs_quest = li.needs_quest; needs_quest = li.needs_quest;
randomBonusListId = ItemEnchantmentManager.GenerateItemRandomBonusListId(itemid); randomBonusListId = ItemEnchantmentManager.GenerateItemRandomBonusListId(itemid);
upgradeId = Global.DB2Mgr.GetRulesetItemUpgrade(itemid);
canSave = true; canSave = true;
} }
@@ -88,7 +87,6 @@ namespace Game.Loots
public uint itemid; public uint itemid;
public uint randomBonusListId; public uint randomBonusListId;
public uint upgradeId;
public List<uint> BonusListIDs = new List<uint>(); public List<uint> BonusListIDs = new List<uint>();
public byte context; public byte context;
public List<Condition> conditions = new List<Condition>(); // additional loot condition public List<Condition> conditions = new List<Condition>(); // additional loot condition
@@ -57,7 +57,7 @@ namespace Game.Maps
return null; return null;
} }
if (entranceId != 0 && !CliDB.WorldSafeLocsStorage.ContainsKey(entranceId)) if (entranceId != 0 && Global.ObjectMgr.GetWorldSafeLoc(entranceId) == null)
{ {
Log.outWarn(LogFilter.Misc, "InstanceSaveManager.AddInstanceSave: invalid entranceId = {0} defined for instance save with mapid = {1}, instanceid = {2}!", entranceId, mapId, instanceId); Log.outWarn(LogFilter.Misc, "InstanceSaveManager.AddInstanceSave: invalid entranceId = {0} defined for instance save with mapid = {1}, instanceid = {2}!", entranceId, mapId, instanceId);
entranceId = 0; entranceId = 0;
+1 -1
View File
@@ -4320,7 +4320,7 @@ namespace Game.Maps
List<Map> m_childTerrainMaps = new List<Map>(); // contains m_parentMap of maps that have MapEntry::ParentMapID == GetId() List<Map> m_childTerrainMaps = new List<Map>(); // contains m_parentMap of maps that have MapEntry::ParentMapID == GetId()
SortedMultiMap<long, ScriptAction> m_scriptSchedule = new SortedMultiMap<long, ScriptAction>(); SortedMultiMap<long, ScriptAction> m_scriptSchedule = new SortedMultiMap<long, ScriptAction>();
BitArray marked_cells = new BitArray(MapConst.TotalCellsPerMap * MapConst.TotalCellsPerMap); BitSet marked_cells = new BitSet(MapConst.TotalCellsPerMap * MapConst.TotalCellsPerMap);
public Dictionary<uint, CreatureGroup> CreatureGroupHolder = new Dictionary<uint, CreatureGroup>(); public Dictionary<uint, CreatureGroup> CreatureGroupHolder = new Dictionary<uint, CreatureGroup>();
internal uint i_InstanceId; internal uint i_InstanceId;
long i_gridExpiry; long i_gridExpiry;
+2 -4
View File
@@ -35,7 +35,7 @@ namespace Game.Network.Packets
uint count = _worldPacket.ReadBits<uint>(13); uint count = _worldPacket.ReadBits<uint>(13);
for (uint i = 0; i < count; ++i) for (uint i = 0; i < count; ++i)
{ {
Queries.Add(new DBQueryRecord(_worldPacket.ReadPackedGuid(), _worldPacket.ReadUInt32())); Queries.Add(new DBQueryRecord(_worldPacket.ReadUInt32()));
} }
} }
@@ -44,13 +44,11 @@ namespace Game.Network.Packets
public struct DBQueryRecord public struct DBQueryRecord
{ {
public DBQueryRecord(ObjectGuid guid, uint recordId) public DBQueryRecord(uint recordId)
{ {
GUID = guid;
RecordID = recordId; RecordID = recordId;
} }
public ObjectGuid GUID;
public uint RecordID; public uint RecordID;
} }
} }
+2 -10
View File
@@ -774,25 +774,17 @@ namespace Game.Network.Packets
if (lootItem.randomBonusListId != 0) if (lootItem.randomBonusListId != 0)
ItemBonus.Value.BonusListIDs.Add(lootItem.randomBonusListId); ItemBonus.Value.BonusListIDs.Add(lootItem.randomBonusListId);
} }
if (lootItem.upgradeId != 0)
{
Modifications.HasValue = true;
Modifications.Value.Insert((int)ItemModifier.UpgradeId, (int)lootItem.upgradeId);
}
} }
public ItemInstance(VoidStorageItem voidItem) public ItemInstance(VoidStorageItem voidItem)
{ {
ItemID = voidItem.ItemEntry; ItemID = voidItem.ItemEntry;
if (voidItem.ItemUpgradeId != 0 || voidItem.FixedScalingLevel != 0 || voidItem.ArtifactKnowledgeLevel != 0) if (voidItem.FixedScalingLevel != 0 || voidItem.ArtifactKnowledgeLevel != 0)
{ {
Modifications.HasValue = true; Modifications.HasValue = true;
if (voidItem.ItemUpgradeId != 0)
Modifications.Value.Insert((int)ItemModifier.UpgradeId, (int)voidItem.ItemUpgradeId);
if (voidItem.FixedScalingLevel != 0) if (voidItem.FixedScalingLevel != 0)
Modifications.Value.Insert((int)ItemModifier.ScalingStatDistributionFixedLevel, (int)voidItem.FixedScalingLevel); Modifications.Value.Insert((int)ItemModifier.TimewalkerLevel, (int)voidItem.FixedScalingLevel);
if (voidItem.ArtifactKnowledgeLevel != 0) if (voidItem.ArtifactKnowledgeLevel != 0)
Modifications.Value.Insert((int)ItemModifier.ArtifactKnowledgeLevel, (int)voidItem.ArtifactKnowledgeLevel); Modifications.Value.Insert((int)ItemModifier.ArtifactKnowledgeLevel, (int)voidItem.ArtifactKnowledgeLevel);
} }
+2 -2
View File
@@ -450,11 +450,11 @@ namespace Game.Network.Packets
public override void Write() public override void Write()
{ {
_worldPacket.WriteInt32(MapID); _worldPacket.WriteInt32(MapID);
_worldPacket.WriteVector3(Loc); _worldPacket.WriteXYZ(Loc);
} }
public int MapID; public int MapID;
public Vector3 Loc; public WorldLocation Loc;
} }
public class PortGraveyard : ClientPacket public class PortGraveyard : ClientPacket
+3
View File
@@ -581,6 +581,9 @@ namespace Game
Log.outInfo(LogFilter.ServerLoading, "Loading SpellArea Data..."); // must be after quest load Log.outInfo(LogFilter.ServerLoading, "Loading SpellArea Data..."); // must be after quest load
Global.SpellMgr.LoadSpellAreas(); Global.SpellMgr.LoadSpellAreas();
Log.outInfo(LogFilter.ServerLoading, "Loading World locations...");
Global.ObjectMgr.LoadWorldSafeLocs(); // must be before LoadAreaTriggerTeleports and LoadGraveyardZones
Log.outInfo(LogFilter.ServerLoading, "Loading AreaTrigger definitions..."); Log.outInfo(LogFilter.ServerLoading, "Loading AreaTrigger definitions...");
Global.ObjectMgr.LoadAreaTriggerTeleports(); Global.ObjectMgr.LoadAreaTriggerTeleports();
+23 -18
View File
@@ -1990,92 +1990,97 @@ namespace Game.Entities
effectsBySpell[effect.SpellID][effect.DifficultyID][effect.EffectIndex] = effect; effectsBySpell[effect.SpellID][effect.DifficultyID][effect.EffectIndex] = effect;
} }
foreach (var spell in CliDB.SpellNameStorage.Values) SpellInfoLoadHelper GetSpellInfoLoadHelper(uint spellId)
loadData[spell.Id] = new SpellInfoLoadHelper(); {
if (!loadData.ContainsKey(spellId))
loadData[spellId] = new SpellInfoLoadHelper();
return loadData[spellId];
}
foreach (SpellAuraOptionsRecord auraOptions in CliDB.SpellAuraOptionsStorage.Values) foreach (SpellAuraOptionsRecord auraOptions in CliDB.SpellAuraOptionsStorage.Values)
if (auraOptions.DifficultyID == 0) // TODO: implement if (auraOptions.DifficultyID == 0) // TODO: implement
loadData[auraOptions.SpellID].AuraOptions = auraOptions; GetSpellInfoLoadHelper(auraOptions.SpellID).AuraOptions = auraOptions;
CliDB.SpellAuraOptionsStorage.Clear(); CliDB.SpellAuraOptionsStorage.Clear();
foreach (SpellAuraRestrictionsRecord auraRestrictions in CliDB.SpellAuraRestrictionsStorage.Values) foreach (SpellAuraRestrictionsRecord auraRestrictions in CliDB.SpellAuraRestrictionsStorage.Values)
{ {
if (auraRestrictions.DifficultyID == 0) // TODO: implement if (auraRestrictions.DifficultyID == 0) // TODO: implement
loadData[auraRestrictions.SpellID].AuraRestrictions = auraRestrictions; GetSpellInfoLoadHelper(auraRestrictions.SpellID).AuraRestrictions = auraRestrictions;
} }
CliDB.SpellAuraRestrictionsStorage.Clear(); CliDB.SpellAuraRestrictionsStorage.Clear();
foreach (SpellCastingRequirementsRecord castingRequirements in CliDB.SpellCastingRequirementsStorage.Values) foreach (SpellCastingRequirementsRecord castingRequirements in CliDB.SpellCastingRequirementsStorage.Values)
loadData[castingRequirements.SpellID].CastingRequirements = castingRequirements; GetSpellInfoLoadHelper(castingRequirements.SpellID).CastingRequirements = castingRequirements;
CliDB.SpellCastingRequirementsStorage.Clear(); CliDB.SpellCastingRequirementsStorage.Clear();
foreach (SpellCategoriesRecord categories in CliDB.SpellCategoriesStorage.Values) foreach (SpellCategoriesRecord categories in CliDB.SpellCategoriesStorage.Values)
{ {
if (categories.DifficultyID == 0) // TODO: implement if (categories.DifficultyID == 0) // TODO: implement
loadData[categories.SpellID].Categories = categories; GetSpellInfoLoadHelper(categories.SpellID).Categories = categories;
} }
CliDB.SpellCategoriesStorage.Clear(); CliDB.SpellCategoriesStorage.Clear();
foreach (SpellClassOptionsRecord classOptions in CliDB.SpellClassOptionsStorage.Values) foreach (SpellClassOptionsRecord classOptions in CliDB.SpellClassOptionsStorage.Values)
loadData[classOptions.SpellID].ClassOptions = classOptions; GetSpellInfoLoadHelper(classOptions.SpellID).ClassOptions = classOptions;
CliDB.SpellClassOptionsStorage.Clear(); CliDB.SpellClassOptionsStorage.Clear();
foreach (SpellCooldownsRecord cooldowns in CliDB.SpellCooldownsStorage.Values) foreach (SpellCooldownsRecord cooldowns in CliDB.SpellCooldownsStorage.Values)
{ {
if (cooldowns.DifficultyID == 0) // TODO: implement if (cooldowns.DifficultyID == 0) // TODO: implement
loadData[cooldowns.SpellID].Cooldowns = cooldowns; GetSpellInfoLoadHelper(cooldowns.SpellID).Cooldowns = cooldowns;
} }
CliDB.SpellCooldownsStorage.Clear(); CliDB.SpellCooldownsStorage.Clear();
foreach (SpellEquippedItemsRecord equippedItems in CliDB.SpellEquippedItemsStorage.Values) foreach (SpellEquippedItemsRecord equippedItems in CliDB.SpellEquippedItemsStorage.Values)
loadData[equippedItems.SpellID].EquippedItems = equippedItems; GetSpellInfoLoadHelper(equippedItems.SpellID).EquippedItems = equippedItems;
CliDB.SpellEquippedItemsStorage.Clear(); CliDB.SpellEquippedItemsStorage.Clear();
foreach (SpellInterruptsRecord interrupts in CliDB.SpellInterruptsStorage.Values) foreach (SpellInterruptsRecord interrupts in CliDB.SpellInterruptsStorage.Values)
{ {
if (interrupts.DifficultyID == 0) // TODO: implement if (interrupts.DifficultyID == 0) // TODO: implement
loadData[interrupts.SpellID].Interrupts = interrupts; GetSpellInfoLoadHelper(interrupts.SpellID).Interrupts = interrupts;
} }
CliDB.SpellInterruptsStorage.Clear(); CliDB.SpellInterruptsStorage.Clear();
foreach (SpellLevelsRecord levels in CliDB.SpellLevelsStorage.Values) foreach (SpellLevelsRecord levels in CliDB.SpellLevelsStorage.Values)
{ {
if (levels.DifficultyID == 0) // TODO: implement if (levels.DifficultyID == 0) // TODO: implement
loadData[levels.SpellID].Levels = levels; GetSpellInfoLoadHelper(levels.SpellID).Levels = levels;
} }
foreach (SpellMiscRecord misc in CliDB.SpellMiscStorage.Values) foreach (SpellMiscRecord misc in CliDB.SpellMiscStorage.Values)
if (misc.DifficultyID == 0) if (misc.DifficultyID == 0)
loadData[misc.SpellID].Misc = misc; GetSpellInfoLoadHelper(misc.SpellID).Misc = misc;
foreach (SpellReagentsRecord reagents in CliDB.SpellReagentsStorage.Values) foreach (SpellReagentsRecord reagents in CliDB.SpellReagentsStorage.Values)
loadData[reagents.SpellID].Reagents = reagents; GetSpellInfoLoadHelper(reagents.SpellID).Reagents = reagents;
CliDB.SpellReagentsStorage.Clear(); CliDB.SpellReagentsStorage.Clear();
foreach (SpellScalingRecord scaling in CliDB.SpellScalingStorage.Values) foreach (SpellScalingRecord scaling in CliDB.SpellScalingStorage.Values)
loadData[scaling.SpellID].Scaling = scaling; GetSpellInfoLoadHelper(scaling.SpellID).Scaling = scaling;
CliDB.SpellScalingStorage.Clear(); CliDB.SpellScalingStorage.Clear();
foreach (SpellShapeshiftRecord shapeshift in CliDB.SpellShapeshiftStorage.Values) foreach (SpellShapeshiftRecord shapeshift in CliDB.SpellShapeshiftStorage.Values)
loadData[shapeshift.SpellID].Shapeshift = shapeshift; GetSpellInfoLoadHelper(shapeshift.SpellID).Shapeshift = shapeshift;
CliDB.SpellShapeshiftStorage.Clear(); CliDB.SpellShapeshiftStorage.Clear();
foreach (SpellTargetRestrictionsRecord targetRestrictions in CliDB.SpellTargetRestrictionsStorage.Values) foreach (SpellTargetRestrictionsRecord targetRestrictions in CliDB.SpellTargetRestrictionsStorage.Values)
{ {
if (targetRestrictions.DifficultyID == 0) // TODO: implement if (targetRestrictions.DifficultyID == 0) // TODO: implement
loadData[targetRestrictions.SpellID].TargetRestrictions = targetRestrictions; GetSpellInfoLoadHelper(targetRestrictions.SpellID).TargetRestrictions = targetRestrictions;
} }
CliDB.SpellTargetRestrictionsStorage.Clear(); CliDB.SpellTargetRestrictionsStorage.Clear();
foreach (SpellTotemsRecord totems in CliDB.SpellTotemsStorage.Values) foreach (SpellTotemsRecord totems in CliDB.SpellTotemsStorage.Values)
loadData[totems.SpellID].Totems = totems; GetSpellInfoLoadHelper(totems.SpellID).Totems = totems;
CliDB.SpellTotemsStorage.Clear(); CliDB.SpellTotemsStorage.Clear();
@@ -2089,7 +2094,7 @@ namespace Game.Entities
foreach (var spellEntry in CliDB.SpellNameStorage.Values) foreach (var spellEntry in CliDB.SpellNameStorage.Values)
{ {
loadData[spellEntry.Id].Entry = spellEntry; GetSpellInfoLoadHelper(spellEntry.Id).Entry = spellEntry;
mSpellInfoMap[spellEntry.Id] = new SpellInfo(loadData[spellEntry.Id], effectsBySpell.LookupByKey(spellEntry.Id), visualsBySpell.LookupByKey(spellEntry.Id)); mSpellInfoMap[spellEntry.Id] = new SpellInfo(loadData[spellEntry.Id], effectsBySpell.LookupByKey(spellEntry.Id), visualsBySpell.LookupByKey(spellEntry.Id));
} }
+3 -3
View File
@@ -1624,7 +1624,6 @@ CREATE TABLE `character_void_storage` (
`slot` tinyint(3) unsigned NOT NULL, `slot` tinyint(3) unsigned NOT NULL,
`creatorGuid` bigint(20) unsigned NOT NULL DEFAULT '0', `creatorGuid` bigint(20) unsigned NOT NULL DEFAULT '0',
`randomBonusListId` int(10) unsigned NOT NULL DEFAULT '0', `randomBonusListId` int(10) unsigned NOT NULL DEFAULT '0',
`upgradeId` int(10) unsigned NOT NULL DEFAULT '0',
`fixedScalingLevel` int(10) unsigned DEFAULT '0', `fixedScalingLevel` int(10) unsigned DEFAULT '0',
`artifactKnowledgeLevel` int(10) unsigned DEFAULT '0', `artifactKnowledgeLevel` int(10) unsigned DEFAULT '0',
`context` tinyint(3) unsigned NOT NULL DEFAULT '0', `context` tinyint(3) unsigned NOT NULL DEFAULT '0',
@@ -2787,7 +2786,6 @@ CREATE TABLE `item_instance` (
`playedTime` int(10) unsigned NOT NULL DEFAULT '0', `playedTime` int(10) unsigned NOT NULL DEFAULT '0',
`text` text, `text` text,
`transmogrification` int(10) unsigned NOT NULL DEFAULT '0', `transmogrification` int(10) unsigned NOT NULL DEFAULT '0',
`upgradeId` int(10) unsigned NOT NULL DEFAULT '0',
`enchantIllusion` int(10) unsigned NOT NULL DEFAULT '0', `enchantIllusion` int(10) unsigned NOT NULL DEFAULT '0',
`battlePetSpeciesId` int(10) unsigned NOT NULL DEFAULT '0', `battlePetSpeciesId` int(10) unsigned NOT NULL DEFAULT '0',
`battlePetBreedData` int(10) unsigned NOT NULL DEFAULT '0', `battlePetBreedData` int(10) unsigned NOT NULL DEFAULT '0',
@@ -3570,7 +3568,9 @@ INSERT INTO `updates` VALUES
('2019_06_08_00_characters.sql','6C5AF52AEF03BC019B96E7A07592C22660F9327B','RELEASED','2019-06-03 20:04:47',0), ('2019_06_08_00_characters.sql','6C5AF52AEF03BC019B96E7A07592C22660F9327B','RELEASED','2019-06-03 20:04:47',0),
('2019_06_08_01_characters.sql','55076AFAF4B55DB4E34029C269EE0C84315C31BA','RELEASED','2019-06-04 22:11:47',0), ('2019_06_08_01_characters.sql','55076AFAF4B55DB4E34029C269EE0C84315C31BA','RELEASED','2019-06-04 22:11:47',0),
('2019_06_25_00_characters.sql','B8CBF79DEE02B40B01424327D31E52C70335BEC6','RELEASED','2019-06-25 22:40:37',0), ('2019_06_25_00_characters.sql','B8CBF79DEE02B40B01424327D31E52C70335BEC6','RELEASED','2019-06-25 22:40:37',0),
('2019_07_15_00_characters.sql','E1C77F604FB2A2FE8B32258CD0C9EC71BEA4F0FF','RELEASED','2019-06-25 22:40:37',0); ('2019_07_15_00_characters.sql','E1C77F604FB2A2FE8B32258CD0C9EC71BEA4F0FF','RELEASED','2019-06-25 22:40:37',0),
('2019_10_26_00_characters.sql','F1090ACDEB876A7BB5ED8829373F6305A217949A','RELEASED','2019-10-25 23:04:42',0),
('2019_10_26_01_characters.sql','59D5860930D02AB77D2AAA704C564957A9143760','RELEASED','2019-10-26 22:04:46',0);
/*!40000 ALTER TABLE `updates` ENABLE KEYS */; /*!40000 ALTER TABLE `updates` ENABLE KEYS */;
UNLOCK TABLES; UNLOCK TABLES;
@@ -0,0 +1,2 @@
ALTER TABLE `character_void_storage` DROP `upgradeId`;
ALTER TABLE `item_instance` DROP `upgradeId`;
@@ -0,0 +1,35 @@
ALTER TABLE `item_appearance` ADD `SubclassID` int(11) NOT NULL DEFAULT 0 AFTER `DisplayType`;
ALTER TABLE `item_sparse` CHANGE `ZoneBound` `ZoneBound1` smallint(5) unsigned NOT NULL DEFAULT 0 AFTER `InstanceBound`;
ALTER TABLE `item_sparse` ADD `ZoneBound2` smallint(5) unsigned NOT NULL DEFAULT 0 AFTER `ZoneBound1`;
ALTER TABLE `power_type` MODIFY `ID` int(10) UNSIGNED NOT NULL DEFAULT 0 AFTER `CostGlobalStringTag`;
ALTER TABLE `spell_effect` MODIFY `EffectAura` smallint(6) NOT NULL DEFAULT 0 AFTER `ID`;
ALTER TABLE `spell_misc` MODIFY `Attributes1` int(11) NOT NULL DEFAULT 0 AFTER `ID`;
ALTER TABLE `spell_misc` MODIFY `Attributes2` int(11) NOT NULL DEFAULT 0 AFTER `Attributes1`;
ALTER TABLE `spell_misc` MODIFY `Attributes3` int(11) NOT NULL DEFAULT 0 AFTER `Attributes2`;
ALTER TABLE `spell_misc` MODIFY `Attributes4` int(11) NOT NULL DEFAULT 0 AFTER `Attributes3`;
ALTER TABLE `spell_misc` MODIFY `Attributes5` int(11) NOT NULL DEFAULT 0 AFTER `Attributes4`;
ALTER TABLE `spell_misc` MODIFY `Attributes6` int(11) NOT NULL DEFAULT 0 AFTER `Attributes5`;
ALTER TABLE `spell_misc` MODIFY `Attributes7` int(11) NOT NULL DEFAULT 0 AFTER `Attributes6`;
ALTER TABLE `spell_misc` MODIFY `Attributes8` int(11) NOT NULL DEFAULT 0 AFTER `Attributes7`;
ALTER TABLE `spell_misc` MODIFY `Attributes9` int(11) NOT NULL DEFAULT 0 AFTER `Attributes8`;
ALTER TABLE `spell_misc` MODIFY `Attributes10` int(11) NOT NULL DEFAULT 0 AFTER `Attributes9`;
ALTER TABLE `spell_misc` MODIFY `Attributes11` int(11) NOT NULL DEFAULT 0 AFTER `Attributes10`;
ALTER TABLE `spell_misc` MODIFY `Attributes12` int(11) NOT NULL DEFAULT 0 AFTER `Attributes11`;
ALTER TABLE `spell_misc` MODIFY `Attributes13` int(11) NOT NULL DEFAULT 0 AFTER `Attributes12`;
ALTER TABLE `spell_misc` MODIFY `Attributes14` int(11) NOT NULL DEFAULT 0 AFTER `Attributes13`;
ALTER TABLE `spell_visual_kit` MODIFY `FallbackPriority` tinyint(4) NOT NULL DEFAULT 0 AFTER `Flags`;
ALTER TABLE `spell_visual_kit` MODIFY `FallbackSpellVisualKitId` int(10) UNSIGNED NOT NULL DEFAULT 0 AFTER `FallbackPriority`;
ALTER TABLE `transmog_set` ADD `PlayerConditionID` int(11) NOT NULL DEFAULT 0 AFTER `UiOrder`;
ALTER TABLE `unit_power_bar` MODIFY `StartPower` int(10) UNSIGNED NOT NULL DEFAULT 0 AFTER `MaxPower`;
DROP TABLE `item_upgrade`;
DROP TABLE `ruleset_item_upgrade`;
DROP TABLE `world_safe_locs`;
DROP TABLE `world_safe_locs_locale`;
File diff suppressed because it is too large Load Diff