Core: Updated to 11.2.5.63704
Port From (https://github.com/TrinityCore/TrinityCore/commit/53068a94e88991ae7196fb247df4b7ca2e47e554)
This commit is contained in:
@@ -186,11 +186,17 @@ namespace BNetServer.Networking
|
||||
if (!authed)
|
||||
return BattlenetRpcErrorCode.Denied;
|
||||
|
||||
if (request.Program != 0x576F57)
|
||||
switch (request.Program)
|
||||
{
|
||||
case 0x417070: // App
|
||||
case 0x576F57: // WoW
|
||||
break;
|
||||
default:
|
||||
{
|
||||
Log.outDebug(LogFilter.Session, $"[Battlenet::HandleGenerateWebCredentials] {GetClientInfo()} attempted to generate web cretentials with game other than WoW (using {(request.Program >> 24) & 0xFF}{(request.Program >> 16) & 0xFF}{(request.Program >> 8) & 0xFF}{request.Program & 0xFF})!");
|
||||
return BattlenetRpcErrorCode.BadProgram;
|
||||
}
|
||||
}
|
||||
|
||||
PreparedStatement stmt = LoginDatabase.GetPreparedStatement(LoginStatements.SEL_BNET_EXISTING_AUTHENTICATION_BY_ID);
|
||||
stmt.AddValue(0, accountInfo.Id);
|
||||
|
||||
@@ -22,12 +22,15 @@ namespace Framework.Constants
|
||||
PerCharacterEditModeCache = 14,
|
||||
GlobalFrontendChatSettings = 15,
|
||||
GlobalCharacterListOrder = 16,
|
||||
GlobalCooldownManager = 17,
|
||||
PerCharacterCooldownManager2 = 18,
|
||||
GlobalShop2PendingOrders = 19,
|
||||
|
||||
Max = 17,
|
||||
Max = 20,
|
||||
|
||||
AllAccountDataCacheMask = 0x0001FFFFu,
|
||||
GlobalCacheMask = 0x0001A515u,
|
||||
PerCharacterCacheMask = 0x00005AEAu
|
||||
AllAccountDataCacheMask = 0x000FFFFFu,
|
||||
GlobalCacheMask = 0x000BA515u,
|
||||
PerCharacterCacheMask = 0x00045AEAu
|
||||
}
|
||||
|
||||
public enum TutorialAction
|
||||
|
||||
@@ -2609,7 +2609,8 @@ namespace Framework.Constants
|
||||
{
|
||||
Gold = 0,
|
||||
CurrencyTypesBased = 1,
|
||||
TraitSourced = 2
|
||||
TraitSourced = 2,
|
||||
TraitSourcedPlayerDataElement = 3,
|
||||
}
|
||||
|
||||
public enum TraitEdgeType
|
||||
@@ -2633,7 +2634,8 @@ namespace Framework.Constants
|
||||
SpendDiamond = 6,
|
||||
ProfPath = 7,
|
||||
ProfPerk = 8,
|
||||
ProfPathUnlock = 9
|
||||
ProfPathUnlock = 9,
|
||||
SpendInfinite = 10
|
||||
}
|
||||
|
||||
[Flags]
|
||||
@@ -2658,6 +2660,12 @@ namespace Framework.Constants
|
||||
Multiply = 1
|
||||
}
|
||||
|
||||
public enum TraitSystemVariationType
|
||||
{
|
||||
None = 0,
|
||||
Spec = 1
|
||||
}
|
||||
|
||||
[Flags]
|
||||
public enum TraitTreeFlag
|
||||
{
|
||||
|
||||
@@ -477,6 +477,9 @@ namespace Framework.Constants
|
||||
OverrideDescriptionColor = 45, // Overrides color of item description and upgrade track if TimeEvent from value[1] has passed
|
||||
OverrideCannotTradeBop = 46,
|
||||
BondingWithPriority = 47,
|
||||
ItemOffsetCurve = 48,
|
||||
ScalingConfigAndReqLevel = 49,
|
||||
ScalingConfig = 51,
|
||||
}
|
||||
|
||||
public enum ItemCollectionType : byte
|
||||
@@ -489,6 +492,10 @@ namespace Framework.Constants
|
||||
RuneforgeLegendaryAbility = 5,
|
||||
TransmogIllusion = 6,
|
||||
WarbandScene = 7,
|
||||
Room = 8,
|
||||
ExteriorFixture = 9,
|
||||
RoomTheme = 10,
|
||||
RoomMaterial = 11
|
||||
}
|
||||
|
||||
public enum ItemContext : byte
|
||||
@@ -658,6 +665,27 @@ namespace Framework.Constants
|
||||
TournamentRealm2 = 162,
|
||||
TournamentRealm3 = 163,
|
||||
TournamentRealm4 = 164,
|
||||
Warbound1 = 165,
|
||||
Warbound2 = 166,
|
||||
Warbound3 = 167,
|
||||
Warbound4 = 168,
|
||||
Warbound5 = 169,
|
||||
Warbound6 = 170,
|
||||
Warbound7 = 171,
|
||||
Warbound8 = 172,
|
||||
Warbound9 = 173,
|
||||
Warbound10 = 174,
|
||||
Warbound11 = 175,
|
||||
Warbound12 = 176,
|
||||
Warbound13 = 177,
|
||||
Warbound14 = 178,
|
||||
Warbound15 = 179,
|
||||
Warbound16 = 180,
|
||||
Warbound17 = 181,
|
||||
Warbound18 = 182,
|
||||
Warbound19 = 183,
|
||||
Warbound20 = 184,
|
||||
Endeavors = 185,
|
||||
|
||||
Max
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -19,6 +19,10 @@ namespace Framework.Constants
|
||||
Calendar = 11,
|
||||
Mail = 12,
|
||||
PvP = 13,
|
||||
PvPScoreboard = 14,
|
||||
PvPGroupMember = 15,
|
||||
CraftingOrder = 16,
|
||||
RecentAlly = 17
|
||||
}
|
||||
|
||||
public enum ReportMajorCategory
|
||||
|
||||
@@ -35,13 +35,13 @@ namespace Framework.Database
|
||||
"subject, deliver_time, expire_time, money, has_items FROM mail WHERE receiver = ? ");
|
||||
PrepareStatement(CharStatements.SEL_MAIL_LIST_ITEMS, "SELECT itemEntry,count FROM item_instance WHERE guid = ?");
|
||||
PrepareStatement(CharStatements.SEL_ENUM, "SELECT c.guid, c.name, c.race, c.class, c.gender, c.level, c.zone, c.map, c.position_x, c.position_y, c.position_z, " +
|
||||
"gm.guildid, c.playerFlags, c.at_login, cp.entry, cp.modelid, cp.level AS cpLevel, c.equipmentCache, cb.guid AS cbGuid, c.slot, c.logout_time, c.activeTalentGroup, c.lastLoginBuild, " +
|
||||
"gm.guildid, c.playerFlags, c.at_login, cp.entry, cp.modelid, cp.level AS cpLevel, c.equipmentCache, cb.guid AS cbGuid, c.slot, c.createTime, c.logout_time, c.activeTalentGroup, c.lastLoginBuild, " +
|
||||
"c.personalTabardEmblemStyle, c.personalTabardEmblemColor, c.personalTabardBorderStyle, c.personalTabardBorderColor, c.personalTabardBackgroundColor " +
|
||||
"FROM characters AS c LEFT JOIN character_pet AS cp ON c.summonedPetNumber = cp.id LEFT JOIN guild_member AS gm ON c.guid = gm.guid " +
|
||||
"LEFT JOIN character_banned AS cb ON c.guid = cb.guid AND cb.active = 1 " +
|
||||
"WHERE c.account = ? AND c.deleteInfos_Name IS NULL");
|
||||
PrepareStatement(CharStatements.SEL_ENUM_DECLINED_NAME, "SELECT c.guid, c.name, c.race, c.class, c.gender, c.level, c.zone, c.map, c.position_x, c.position_y, c.position_z, " +
|
||||
"gm.guildid, c.playerFlags, c.at_login, cp.entry, cp.modelid, cp.level AS cpLevel, c.equipmentCache, cb.guid AS cbGuid, c.slot, c.logout_time, c.activeTalentGroup, c.lastLoginBuild, " +
|
||||
"gm.guildid, c.playerFlags, c.at_login, cp.entry, cp.modelid, cp.level AS cpLevel, c.equipmentCache, cb.guid AS cbGuid, c.slot, c.createTime, c.logout_time, c.activeTalentGroup, c.lastLoginBuild, " +
|
||||
"c.personalTabardEmblemStyle, c.personalTabardEmblemColor, c.personalTabardBorderStyle, c.personalTabardBorderColor, c.personalTabardBackgroundColor, cd.genitive " +
|
||||
"FROM characters AS c LEFT JOIN character_pet AS cp ON c.summonedPetNumber = cp.id LEFT JOIN guild_member AS gm ON c.guid = gm.guid " +
|
||||
"LEFT JOIN character_banned AS cb ON c.guid = cb.guid AND cb.active = 1 LEFT JOIN character_declinedname AS cd ON c.guid = cd.guid " +
|
||||
@@ -49,13 +49,13 @@ namespace Framework.Database
|
||||
PrepareStatement(CharStatements.SEL_ENUM_CUSTOMIZATIONS, "SELECT cc.guid, cc.chrCustomizationOptionID, cc.chrCustomizationChoiceID FROM character_customizations cc " +
|
||||
"LEFT JOIN characters c ON cc.guid = c.guid WHERE c.account = ? AND c.deleteInfos_Name IS NULL ORDER BY cc.guid, cc.chrCustomizationOptionID");
|
||||
PrepareStatement(CharStatements.SEL_UNDELETE_ENUM, "SELECT c.guid, c.deleteInfos_Name, c.race, c.class, c.gender, c.level, c.zone, c.map, c.position_x, c.position_y, c.position_z, " +
|
||||
"gm.guildid, c.playerFlags, c.at_login, cp.entry, cp.modelid, cp.level AS cpLevel, c.equipmentCache, cb.guid AS cbGuid, c.slot, c.logout_time, c.activeTalentGroup, c.lastLoginBuild, " +
|
||||
"gm.guildid, c.playerFlags, c.at_login, cp.entry, cp.modelid, cp.level AS cpLevel, c.equipmentCache, cb.guid AS cbGuid, c.slot, c.createTime, c.logout_time, c.activeTalentGroup, c.lastLoginBuild, " +
|
||||
"c.personalTabardEmblemStyle, c.personalTabardEmblemColor, c.personalTabardBorderStyle, c.personalTabardBorderColor, c.personalTabardBackgroundColor " +
|
||||
"FROM characters AS c LEFT JOIN character_pet AS cp ON c.summonedPetNumber = cp.id LEFT JOIN guild_member AS gm ON c.guid = gm.guid " +
|
||||
"LEFT JOIN character_banned AS cb ON c.guid = cb.guid AND cb.active = 1 " +
|
||||
"WHERE c.deleteInfos_Account = ? AND c.deleteInfos_Name IS NOT NULL");
|
||||
PrepareStatement(CharStatements.SEL_UNDELETE_ENUM_DECLINED_NAME, "SELECT c.guid, c.deleteInfos_Name, c.race, c.class, c.gender, c.level, c.zone, c.map, c.position_x, c.position_y, c.position_z, " +
|
||||
"gm.guildid, c.playerFlags, c.at_login, cp.entry, cp.modelid, cp.level AS cpLevel, c.equipmentCache, cb.guid AS cbGuid, c.slot, c.logout_time, c.activeTalentGroup, c.lastLoginBuild, " +
|
||||
"gm.guildid, c.playerFlags, c.at_login, cp.entry, cp.modelid, cp.level AS cpLevel, c.equipmentCache, cb.guid AS cbGuid, c.slot, c.createTime, c.logout_time, c.activeTalentGroup, c.lastLoginBuild, " +
|
||||
"c.personalTabardEmblemStyle, c.personalTabardEmblemColor, c.personalTabardBorderStyle, c.personalTabardBorderColor, c.personalTabardBackgroundColor, cd.genitive" +
|
||||
"FROM characters AS c LEFT JOIN character_pet AS cp ON c.summonedPetNumber = cp.id LEFT JOIN guild_member AS gm ON c.guid = gm.guid " +
|
||||
"LEFT JOIN character_banned AS cb ON c.guid = cb.guid AND cb.active = 1 LEFT JOIN character_declinedname AS cd ON c.guid = cd.guid " +
|
||||
@@ -649,8 +649,8 @@ namespace Framework.Database
|
||||
PrepareStatement(CharStatements.INS_CHAR_TRAIT_ENTRIES, "INSERT INTO character_trait_entry (guid, traitConfigId, traitNodeId, traitNodeEntryId, `rank`) VALUES (?, ?, ?, ?, ?)");
|
||||
PrepareStatement(CharStatements.DEL_CHAR_TRAIT_ENTRIES, "DELETE FROM character_trait_entry WHERE guid = ? AND traitConfigId = ?");
|
||||
PrepareStatement(CharStatements.DEL_CHAR_TRAIT_ENTRIES_BY_CHAR, "DELETE FROM character_trait_entry WHERE guid = ?");
|
||||
PrepareStatement(CharStatements.SEL_CHAR_TRAIT_CONFIGS, "SELECT traitConfigId, type, chrSpecializationId, combatConfigFlags, localIdentifier, skillLineId, traitSystemId, `name` FROM character_trait_config WHERE guid = ?");
|
||||
PrepareStatement(CharStatements.INS_CHAR_TRAIT_CONFIGS, "INSERT INTO character_trait_config (guid, traitConfigId, type, chrSpecializationId, combatConfigFlags, localIdentifier, skillLineId, traitSystemId, `name`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)");
|
||||
PrepareStatement(CharStatements.SEL_CHAR_TRAIT_CONFIGS, "SELECT traitConfigId, type, chrSpecializationId, combatConfigFlags, localIdentifier, skillLineId, traitSystemId, variationId, `name` FROM character_trait_config WHERE guid = ?");
|
||||
PrepareStatement(CharStatements.INS_CHAR_TRAIT_CONFIGS, "INSERT INTO character_trait_config (guid, traitConfigId, type, chrSpecializationId, combatConfigFlags, localIdentifier, skillLineId, traitSystemId, variationId, `name`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)");
|
||||
PrepareStatement(CharStatements.DEL_CHAR_TRAIT_CONFIGS, "DELETE FROM character_trait_config WHERE guid = ? AND traitConfigId = ?");
|
||||
PrepareStatement(CharStatements.DEL_CHAR_TRAIT_CONFIGS_BY_CHAR, "DELETE FROM character_trait_config WHERE guid = ?");
|
||||
|
||||
|
||||
@@ -365,8 +365,9 @@ namespace Framework.Database
|
||||
|
||||
// ContentTuning.db2
|
||||
PrepareStatement(HotfixStatements.SEL_CONTENT_TUNING, "SELECT ID, Flags, ExpansionID, HealthItemLevelCurveID, DamageItemLevelCurveID, " +
|
||||
"HealthPrimaryStatCurveID, DamagePrimaryStatCurveID, MinLevel, MaxLevel, MinLevelType, MaxLevelType, TargetLevelDelta, TargetLevelMaxDelta, " +
|
||||
"TargetLevelMin, TargetLevelMax, MinItemLevel, QuestXpMultiplier FROM content_tuning WHERE (`VerifiedBuild` > 0) = ?");
|
||||
"HealthPrimaryStatCurveID, DamagePrimaryStatCurveID, PrimaryStatScalingModPlayerDataElementCharacterID, " +
|
||||
"PrimaryStatScalingModPlayerDataElementCharacterMultiplier, MinLevel, MaxLevel, MinLevelType, MaxLevelType, TargetLevelDelta, " +
|
||||
"TargetLevelMaxDelta, TargetLevelMin, TargetLevelMax, MinItemLevel, QuestXpMultiplier FROM content_tuning WHERE (`VerifiedBuild` > 0) = ?");
|
||||
|
||||
// ContentTuningXExpected.db2
|
||||
PrepareStatement(HotfixStatements.SEL_CONTENT_TUNING_X_EXPECTED, "SELECT ID, ExpectedStatModID, MinMythicPlusSeasonID, MaxMythicPlusSeasonID, " +
|
||||
@@ -722,8 +723,8 @@ namespace Framework.Database
|
||||
|
||||
// ItemBonusTreeNode.db2
|
||||
PrepareStatement(HotfixStatements.SEL_ITEM_BONUS_TREE_NODE, "SELECT ID, ItemContext, ChildItemBonusTreeID, ChildItemBonusListID, ChildItemLevelSelectorID, " +
|
||||
"ChildItemBonusListGroupID, IblGroupPointsModSetID, MinMythicPlusLevel, MaxMythicPlusLevel, ParentItemBonusTreeID FROM item_bonus_tree_node" +
|
||||
" WHERE (`VerifiedBuild` > 0) = ?");
|
||||
"ChildItemBonusListGroupID, IblGroupPointsModSetID, MinMythicPlusLevel, MaxMythicPlusLevel, ItemCreationContextGroupID, Flags, " +
|
||||
"ParentItemBonusTreeID FROM item_bonus_tree_node WHERE (`VerifiedBuild` > 0) = ?");
|
||||
|
||||
// ItemChildEquipment.db2
|
||||
PrepareStatement(HotfixStatements.SEL_ITEM_CHILD_EQUIPMENT, "SELECT ID, ParentItemID, ChildItemID, ChildItemEquipSlot FROM item_child_equipment" +
|
||||
@@ -737,6 +738,10 @@ namespace Framework.Database
|
||||
PrepareStatement(HotfixStatements.SEL_ITEM_CONTEXT_PICKER_ENTRY, "SELECT ID, ItemCreationContext, OrderIndex, PVal, LabelID, Flags, PlayerConditionID, " +
|
||||
"ItemContextPickerID FROM item_context_picker_entry WHERE (`VerifiedBuild` > 0) = ?");
|
||||
|
||||
// ItemCreationContext.db2
|
||||
PrepareStatement(HotfixStatements.SEL_ITEM_CREATION_CONTEXT, "SELECT ID, ItemContext, ItemCreationContextGroupID FROM item_creation_context" +
|
||||
" WHERE (`VerifiedBuild` > 0) = ?");
|
||||
|
||||
// ItemCurrencyCost.db2
|
||||
PrepareStatement(HotfixStatements.SEL_ITEM_CURRENCY_COST, "SELECT ID, ItemID FROM item_currency_cost WHERE (`VerifiedBuild` > 0) = ?");
|
||||
|
||||
@@ -808,9 +813,16 @@ namespace Framework.Database
|
||||
PrepareStatement(HotfixStatements.SEL_ITEM_NAME_DESCRIPTION_LOCALE, "SELECT ID, Description_lang FROM item_name_description_locale" +
|
||||
" WHERE (`VerifiedBuild` > 0) = ? AND locale = ?");
|
||||
|
||||
// ItemOffsetCurve.db2
|
||||
PrepareStatement(HotfixStatements.SEL_ITEM_OFFSET_CURVE, "SELECT ID, CurveID, Offset FROM item_offset_curve WHERE (`VerifiedBuild` > 0) = ?");
|
||||
|
||||
// ItemPriceBase.db2
|
||||
PrepareStatement(HotfixStatements.SEL_ITEM_PRICE_BASE, "SELECT ID, ItemLevel, Armor, Weapon FROM item_price_base WHERE (`VerifiedBuild` > 0) = ?");
|
||||
|
||||
// ItemScalingConfig.db2
|
||||
PrepareStatement(HotfixStatements.SEL_ITEM_SCALING_CONFIG, "SELECT ID, ItemOffsetCurveID, ItemLevel, RequiredLevel, Unknown1125 FROM item_scaling_config" +
|
||||
" WHERE (`VerifiedBuild` > 0) = ?");
|
||||
|
||||
// ItemSearchName.db2
|
||||
PrepareStatement(HotfixStatements.SEL_ITEM_SEARCH_NAME, "SELECT ID, AllowableRace, Display, OverallQualityID, ExpansionID, MinFactionID, MinReputation, " +
|
||||
"AllowableClass, RequiredLevel, RequiredSkill, RequiredSkillRank, RequiredAbility, ItemLevel, Flags1, Flags2, Flags3, Flags4, Flags5" +
|
||||
@@ -837,12 +849,12 @@ namespace Framework.Database
|
||||
"StatPercentEditor10, StatModifierBonusStat1, StatModifierBonusStat2, StatModifierBonusStat3, StatModifierBonusStat4, StatModifierBonusStat5, " +
|
||||
"StatModifierBonusStat6, StatModifierBonusStat7, StatModifierBonusStat8, StatModifierBonusStat9, StatModifierBonusStat10, Stackable, " +
|
||||
"MaxCount, MinReputation, RequiredAbility, SellPrice, BuyPrice, VendorStackCount, PriceVariance, PriceRandomValue, Flags1, Flags2, Flags3, " +
|
||||
"Flags4, Flags5, FactionRelated, ModifiedCraftingReagentItemID, ContentTuningID, PlayerLevelToItemLevelCurveID, ItemNameDescriptionID, " +
|
||||
"RequiredTransmogHoliday, RequiredHoliday, GemProperties, SocketMatchEnchantmentId, TotemCategoryID, InstanceBound, ZoneBound1, ZoneBound2, " +
|
||||
"ItemSet, LockID, PageID, ItemDelay, MinFactionID, RequiredSkillRank, RequiredSkill, ItemLevel, AllowableClass, ArtifactID, SpellWeight, " +
|
||||
"SpellWeightCategory, SocketType1, SocketType2, SocketType3, SheatheType, Material, PageMaterialID, Bonding, DamageDamageType, " +
|
||||
"ContainerSlots, RequiredPVPMedal, RequiredPVPRank, RequiredLevel, InventoryType, OverallQualityID FROM item_sparse" +
|
||||
" WHERE (`VerifiedBuild` > 0) = ?");
|
||||
"Flags4, Flags5, FactionRelated, ModifiedCraftingReagentItemID, ContentTuningID, PlayerLevelToItemLevelCurveID, ItemLevelOffsetCurveID, " +
|
||||
"ItemLevelOffsetItemLevel, ItemNameDescriptionID, RequiredTransmogHoliday, RequiredHoliday, GemProperties, SocketMatchEnchantmentId, " +
|
||||
"TotemCategoryID, InstanceBound, ZoneBound1, ZoneBound2, ItemSet, LockID, PageID, ItemDelay, MinFactionID, RequiredSkillRank, RequiredSkill, " +
|
||||
"ItemLevel, AllowableClass, ArtifactID, SpellWeight, SpellWeightCategory, SocketType1, SocketType2, SocketType3, SheatheType, Material, " +
|
||||
"PageMaterialID, Bonding, DamageDamageType, ContainerSlots, RequiredPVPMedal, RequiredPVPRank, RequiredLevel, InventoryType, " +
|
||||
"OverallQualityID FROM item_sparse WHERE (`VerifiedBuild` > 0) = ?");
|
||||
PrepareStatement(HotfixStatements.SEL_ITEM_SPARSE_LOCALE, "SELECT ID, Description_lang, Display3_lang, Display2_lang, Display1_lang, Display_lang" +
|
||||
" FROM item_sparse_locale WHERE (`VerifiedBuild` > 0) = ? AND locale = ?");
|
||||
|
||||
@@ -1068,19 +1080,19 @@ namespace Framework.Database
|
||||
" AND locale = ?");
|
||||
|
||||
// PlayerDataElementAccount.db2
|
||||
PrepareStatement(HotfixStatements.SEL_PLAYER_DATA_ELEMENT_ACCOUNT, "SELECT ID, StorageIndex, Type FROM player_data_element_account" +
|
||||
PrepareStatement(HotfixStatements.SEL_PLAYER_DATA_ELEMENT_ACCOUNT, "SELECT ID, StorageIndex, Type, Unknown1125 FROM player_data_element_account" +
|
||||
" WHERE (`VerifiedBuild` > 0) = ?");
|
||||
|
||||
// PlayerDataElementCharacter.db2
|
||||
PrepareStatement(HotfixStatements.SEL_PLAYER_DATA_ELEMENT_CHARACTER, "SELECT ID, StorageIndex, Type FROM player_data_element_character" +
|
||||
PrepareStatement(HotfixStatements.SEL_PLAYER_DATA_ELEMENT_CHARACTER, "SELECT ID, StorageIndex, Type, Unknown1125 FROM player_data_element_character" +
|
||||
" WHERE (`VerifiedBuild` > 0) = ?");
|
||||
|
||||
// PlayerDataFlagAccount.db2
|
||||
PrepareStatement(HotfixStatements.SEL_PLAYER_DATA_FLAG_ACCOUNT, "SELECT ID, StorageIndex, Unknown1107 FROM player_data_flag_account" +
|
||||
PrepareStatement(HotfixStatements.SEL_PLAYER_DATA_FLAG_ACCOUNT, "SELECT ID, StorageIndex, Unknown1107, Unknown1125 FROM player_data_flag_account" +
|
||||
" WHERE (`VerifiedBuild` > 0) = ?");
|
||||
|
||||
// PlayerDataFlagCharacter.db2
|
||||
PrepareStatement(HotfixStatements.SEL_PLAYER_DATA_FLAG_CHARACTER, "SELECT ID, StorageIndex, Unknown1107 FROM player_data_flag_character" +
|
||||
PrepareStatement(HotfixStatements.SEL_PLAYER_DATA_FLAG_CHARACTER, "SELECT ID, StorageIndex, Unknown1107, Unknown1125 FROM player_data_flag_character" +
|
||||
" WHERE (`VerifiedBuild` > 0) = ?");
|
||||
|
||||
// PowerDisplay.db2
|
||||
@@ -1483,10 +1495,11 @@ namespace Framework.Database
|
||||
"TraitCondAccountElementID FROM trait_cond WHERE (`VerifiedBuild` > 0) = ?");
|
||||
|
||||
// TraitCost.db2
|
||||
PrepareStatement(HotfixStatements.SEL_TRAIT_COST, "SELECT InternalName, ID, Amount, TraitCurrencyID FROM trait_cost WHERE (`VerifiedBuild` > 0) = ?");
|
||||
PrepareStatement(HotfixStatements.SEL_TRAIT_COST, "SELECT InternalName, ID, Amount, TraitCurrencyID, CurveID FROM trait_cost WHERE (`VerifiedBuild` > 0) = ?");
|
||||
|
||||
// TraitCurrency.db2
|
||||
PrepareStatement(HotfixStatements.SEL_TRAIT_CURRENCY, "SELECT ID, Type, CurrencyTypesID, Flags, Icon FROM trait_currency WHERE (`VerifiedBuild` > 0) = ?");
|
||||
PrepareStatement(HotfixStatements.SEL_TRAIT_CURRENCY, "SELECT ID, Type, CurrencyTypesID, Flags, Icon, PlayerDataElementAccountID, " +
|
||||
"PlayerDataElementCharacterID FROM trait_currency WHERE (`VerifiedBuild` > 0) = ?");
|
||||
|
||||
// TraitCurrencySource.db2
|
||||
PrepareStatement(HotfixStatements.SEL_TRAIT_CURRENCY_SOURCE, "SELECT Requirement, ID, TraitCurrencyID, Amount, QuestID, AchievementID, PlayerLevel, " +
|
||||
@@ -1557,6 +1570,10 @@ namespace Framework.Database
|
||||
PrepareStatement(HotfixStatements.SEL_TRAIT_SUB_TREE_LOCALE, "SELECT ID, Name_lang, Description_lang FROM trait_sub_tree_locale WHERE (`VerifiedBuild` > 0) = ?" +
|
||||
" AND locale = ?");
|
||||
|
||||
// TraitSystem.db2
|
||||
PrepareStatement(HotfixStatements.SEL_TRAIT_SYSTEM, "SELECT ID, Flags, WidgetSetID, TraitChangeSpell, ItemID, VariationType FROM trait_system" +
|
||||
" WHERE (`VerifiedBuild` > 0) = ?");
|
||||
|
||||
// TraitTree.db2
|
||||
PrepareStatement(HotfixStatements.SEL_TRAIT_TREE, "SELECT ID, TraitSystemID, Unused1000_1, FirstTraitNodeID, PlayerConditionID, Flags, Unused1000_2, " +
|
||||
"Unused1000_3 FROM trait_tree WHERE (`VerifiedBuild` > 0) = ?");
|
||||
@@ -1611,7 +1628,8 @@ namespace Framework.Database
|
||||
|
||||
// UiMapAssignment.db2
|
||||
PrepareStatement(HotfixStatements.SEL_UI_MAP_ASSIGNMENT, "SELECT UiMinX, UiMinY, UiMaxX, UiMaxY, Region1X, Region1Y, Region1Z, Region2X, Region2Y, " +
|
||||
"Region2Z, ID, UiMapID, OrderIndex, MapID, AreaID, WmoDoodadPlacementID, WmoGroupID FROM ui_map_assignment WHERE (`VerifiedBuild` > 0) = ?");
|
||||
"Region2Z, ID, UiMapID, OrderIndex, MapID, AreaID, WmoDoodadPlacementID, WmoGroupID, Unknown1125 FROM ui_map_assignment" +
|
||||
" WHERE (`VerifiedBuild` > 0) = ?");
|
||||
|
||||
// UiMapLink.db2
|
||||
PrepareStatement(HotfixStatements.SEL_UI_MAP_LINK, "SELECT UiMinX, UiMinY, UiMaxX, UiMaxY, ID, ParentUiMapID, OrderIndex, ChildUiMapID, PlayerConditionID, " +
|
||||
@@ -2040,6 +2058,8 @@ namespace Framework.Database
|
||||
|
||||
SEL_ITEM_CONTEXT_PICKER_ENTRY,
|
||||
|
||||
SEL_ITEM_CREATION_CONTEXT,
|
||||
|
||||
SEL_ITEM_CURRENCY_COST,
|
||||
|
||||
SEL_ITEM_DAMAGE_AMMO,
|
||||
@@ -2076,8 +2096,12 @@ namespace Framework.Database
|
||||
SEL_ITEM_NAME_DESCRIPTION,
|
||||
SEL_ITEM_NAME_DESCRIPTION_LOCALE,
|
||||
|
||||
SEL_ITEM_OFFSET_CURVE,
|
||||
|
||||
SEL_ITEM_PRICE_BASE,
|
||||
|
||||
SEL_ITEM_SCALING_CONFIG,
|
||||
|
||||
SEL_ITEM_SEARCH_NAME,
|
||||
SEL_ITEM_SEARCH_NAME_LOCALE,
|
||||
|
||||
@@ -2441,6 +2465,8 @@ namespace Framework.Database
|
||||
SEL_TRAIT_SUB_TREE,
|
||||
SEL_TRAIT_SUB_TREE_LOCALE,
|
||||
|
||||
SEL_TRAIT_SYSTEM,
|
||||
|
||||
SEL_TRAIT_TREE,
|
||||
|
||||
SEL_TRAIT_TREE_LOADOUT,
|
||||
|
||||
@@ -351,6 +351,29 @@ namespace Framework.IO
|
||||
{
|
||||
WriteUInt32(Time.GetPackedTimeFromDateTime(DateTime.Now));
|
||||
}
|
||||
|
||||
public void Write<T>(T value)
|
||||
{
|
||||
switch (value)
|
||||
{
|
||||
case sbyte v: WriteInt8(v); break;
|
||||
case short v: WriteInt16(v); break;
|
||||
case int v: WriteInt32(v); break;
|
||||
case long v: WriteInt64(v); break;
|
||||
case byte v: WriteUInt8(v); break;
|
||||
case ushort v: WriteUInt16(v); break;
|
||||
case uint v: WriteUInt32(v); break;
|
||||
case ulong v: WriteUInt64(v); break;
|
||||
case float v: WriteFloat(v); break;
|
||||
case double v: WriteDouble(v); break;
|
||||
case string v: WriteString(v); break;
|
||||
case bool v: WriteBit(v); break;
|
||||
case byte[] v: WriteBytes(v); break;
|
||||
case Vector3 v: WriteVector3(v); break;
|
||||
default:
|
||||
throw new InvalidOperationException($"Type {typeof(T)} is not supported for writing.");
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
public bool HasUnfinishedBitPack()
|
||||
|
||||
@@ -3605,19 +3605,12 @@ namespace Game.Achievements
|
||||
{
|
||||
bool hasTraitNodeEntry()
|
||||
{
|
||||
foreach (var traitConfig in referencePlayer.m_activePlayerData.TraitConfigs)
|
||||
{
|
||||
if ((TraitConfigType)(int)traitConfig.Type == TraitConfigType.Combat)
|
||||
{
|
||||
if (referencePlayer.m_activePlayerData.ActiveCombatTraitConfigID != traitConfig.ID
|
||||
|| !((TraitCombatConfigFlags)(int)traitConfig.CombatConfigFlags).HasFlag(TraitCombatConfigFlags.ActiveForSpec))
|
||||
continue;
|
||||
}
|
||||
|
||||
foreach (var traitEntry in traitConfig.Entries)
|
||||
TraitConfig config = referencePlayer.GetTraitConfig((int)(uint)referencePlayer.m_activePlayerData.ActiveCombatTraitConfigID);
|
||||
if (config != null && ((TraitCombatConfigFlags)(int)config.CombatConfigFlags).HasFlag(TraitCombatConfigFlags.ActiveForSpec))
|
||||
foreach (TraitEntry traitEntry in config.Entries)
|
||||
if (traitEntry.TraitNodeEntryID == reqValue)
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
if (!hasTraitNodeEntry())
|
||||
@@ -3626,21 +3619,14 @@ namespace Game.Achievements
|
||||
}
|
||||
case ModifierTreeType.PlayerHasTraitNodeEntryInActiveConfigRankGreaterOrEqualThan: // 341
|
||||
{
|
||||
var traitNodeEntryRank = new Func<short?>(() =>
|
||||
int? traitNodeEntryRank = new Func<int?>(() =>
|
||||
{
|
||||
foreach (var traitConfig in referencePlayer.m_activePlayerData.TraitConfigs)
|
||||
{
|
||||
if ((TraitConfigType)(int)traitConfig.Type == TraitConfigType.Combat)
|
||||
{
|
||||
if (referencePlayer.m_activePlayerData.ActiveCombatTraitConfigID != traitConfig.ID
|
||||
|| !((TraitCombatConfigFlags)(int)traitConfig.CombatConfigFlags).HasFlag(TraitCombatConfigFlags.ActiveForSpec))
|
||||
continue;
|
||||
}
|
||||
|
||||
foreach (var traitEntry in traitConfig.Entries)
|
||||
TraitConfig config = referencePlayer.GetTraitConfig((int)(uint)referencePlayer.m_activePlayerData.ActiveCombatTraitConfigID);
|
||||
if (config != null && ((TraitCombatConfigFlags)(int)config.CombatConfigFlags).HasFlag(TraitCombatConfigFlags.ActiveForSpec))
|
||||
foreach (TraitEntry traitEntry in config.Entries)
|
||||
if (traitEntry.TraitNodeEntryID == secondaryAsset)
|
||||
return (short)traitEntry.Rank;
|
||||
}
|
||||
return traitEntry.Rank;
|
||||
|
||||
return null;
|
||||
})();
|
||||
if (!traitNodeEntryRank.HasValue || traitNodeEntryRank < reqValue)
|
||||
@@ -3673,7 +3659,7 @@ namespace Game.Achievements
|
||||
case ModifierTreeType.PlayerHasAtLeastProfPathRanks: // 355
|
||||
{
|
||||
uint ranks = 0;
|
||||
foreach (TraitConfig traitConfig in referencePlayer.m_activePlayerData.TraitConfigs)
|
||||
foreach (var (_, (traitConfig, _)) in referencePlayer.m_activePlayerData.TraitConfigs)
|
||||
{
|
||||
if ((TraitConfigType)(int)traitConfig.Type != TraitConfigType.Profession)
|
||||
continue;
|
||||
@@ -3751,7 +3737,7 @@ namespace Game.Achievements
|
||||
}
|
||||
case ModifierTreeType.PlayerHasActiveTraitSubTree: // 385
|
||||
{
|
||||
int traitConfigWithSubtree = referencePlayer.m_activePlayerData.TraitConfigs.FindIndexIf(traitConfig =>
|
||||
int traitConfigWithSubtree = referencePlayer.m_activePlayerData.TraitConfigs.FindIf(traitConfig =>
|
||||
{
|
||||
if (traitConfig.Type == (int)TraitConfigType.Combat
|
||||
&& (referencePlayer.m_activePlayerData.ActiveCombatTraitConfigID != traitConfig.ID
|
||||
@@ -3762,7 +3748,7 @@ namespace Game.Achievements
|
||||
{
|
||||
return traitSubTree.TraitSubTreeID == reqValue && traitSubTree.Active != 0;
|
||||
}) >= 0;
|
||||
});
|
||||
}).Item1;
|
||||
if (traitConfigWithSubtree < 0)
|
||||
return false;
|
||||
break;
|
||||
|
||||
@@ -539,7 +539,7 @@ namespace Game
|
||||
CalendarInviteRemoved packet = new();
|
||||
packet.ClearPending = true; // FIXME
|
||||
packet.EventID = calendarEvent.EventId;
|
||||
packet.Flags = flags;
|
||||
packet.Flags = (ushort)flags;
|
||||
packet.InviteGuid = invite.InviteeGuid;
|
||||
|
||||
SendPacketToAllEventRelatives(packet, calendarEvent);
|
||||
|
||||
@@ -2400,7 +2400,7 @@ namespace Game
|
||||
{
|
||||
var getTraitNodeEntryRank = ushort? (int traitNodeEntryId) =>
|
||||
{
|
||||
foreach (var traitConfig in player.m_activePlayerData.TraitConfigs)
|
||||
foreach (var (_, (traitConfig, _)) in player.m_activePlayerData.TraitConfigs)
|
||||
{
|
||||
if ((TraitConfigType)(int)traitConfig.Type == TraitConfigType.Combat)
|
||||
{
|
||||
|
||||
@@ -198,6 +198,7 @@ namespace Game.DataStorage
|
||||
ItemChildEquipmentStorage = ReadDB2<ItemChildEquipmentRecord>("ItemChildEquipment.db2", HotfixStatements.SEL_ITEM_CHILD_EQUIPMENT);
|
||||
ItemClassStorage = ReadDB2<ItemClassRecord>("ItemClass.db2", HotfixStatements.SEL_ITEM_CLASS, HotfixStatements.SEL_ITEM_CLASS_LOCALE);
|
||||
ItemContextPickerEntryStorage = ReadDB2<ItemContextPickerEntryRecord>("ItemContextPickerEntry.db2", HotfixStatements.SEL_ITEM_CONTEXT_PICKER_ENTRY);
|
||||
ItemCreationContextStorage = ReadDB2<ItemCreationContextRecord>("ItemCreationContext.db2", HotfixStatements.SEL_ITEM_CREATION_CONTEXT);
|
||||
ItemCurrencyCostStorage = ReadDB2<ItemCurrencyCostRecord>("ItemCurrencyCost.db2", HotfixStatements.SEL_ITEM_CURRENCY_COST);
|
||||
ItemDamageAmmoStorage = ReadDB2<ItemDamageRecord>("ItemDamageAmmo.db2", HotfixStatements.SEL_ITEM_DAMAGE_AMMO);
|
||||
ItemDamageOneHandStorage = ReadDB2<ItemDamageRecord>("ItemDamageOneHand.db2", HotfixStatements.SEL_ITEM_DAMAGE_ONE_HAND);
|
||||
@@ -216,7 +217,9 @@ namespace Game.DataStorage
|
||||
ItemModifiedAppearanceStorage = ReadDB2<ItemModifiedAppearanceRecord>("ItemModifiedAppearance.db2", HotfixStatements.SEL_ITEM_MODIFIED_APPEARANCE);
|
||||
ItemModifiedAppearanceExtraStorage = ReadDB2<ItemModifiedAppearanceExtraRecord>("ItemModifiedAppearanceExtra.db2", HotfixStatements.SEL_ITEM_MODIFIED_APPEARANCE_EXTRA);
|
||||
ItemNameDescriptionStorage = ReadDB2<ItemNameDescriptionRecord>("ItemNameDescription.db2", HotfixStatements.SEL_ITEM_NAME_DESCRIPTION, HotfixStatements.SEL_ITEM_NAME_DESCRIPTION_LOCALE);
|
||||
ItemOffsetCurveStorage = ReadDB2<ItemOffsetCurveRecord>("ItemOffsetCurve.db2", HotfixStatements.SEL_ITEM_OFFSET_CURVE);
|
||||
ItemPriceBaseStorage = ReadDB2<ItemPriceBaseRecord>("ItemPriceBase.db2", HotfixStatements.SEL_ITEM_PRICE_BASE);
|
||||
ItemScalingConfigStorage = ReadDB2<ItemScalingConfigRecord>("ItemScalingConfig.db2", HotfixStatements.SEL_ITEM_SCALING_CONFIG);
|
||||
ItemSearchNameStorage = ReadDB2<ItemSearchNameRecord>("ItemSearchName.db2", HotfixStatements.SEL_ITEM_SEARCH_NAME, HotfixStatements.SEL_ITEM_SEARCH_NAME_LOCALE);
|
||||
ItemSetStorage = ReadDB2<ItemSetRecord>("ItemSet.db2", HotfixStatements.SEL_ITEM_SET, HotfixStatements.SEL_ITEM_SET_LOCALE);
|
||||
ItemSetSpellStorage = ReadDB2<ItemSetSpellRecord>("ItemSetSpell.db2", HotfixStatements.SEL_ITEM_SET_SPELL);
|
||||
@@ -376,6 +379,7 @@ namespace Game.DataStorage
|
||||
TraitNodeXTraitCostStorage = ReadDB2<TraitNodeXTraitCostRecord>("TraitNodeXTraitCost.db2", HotfixStatements.SEL_TRAIT_NODE_X_TRAIT_COST);
|
||||
TraitNodeXTraitNodeEntryStorage = ReadDB2<TraitNodeXTraitNodeEntryRecord>("TraitNodeXTraitNodeEntry.db2", HotfixStatements.SEL_TRAIT_NODE_X_TRAIT_NODE_ENTRY);
|
||||
TraitSubTreeStorage = ReadDB2<TraitSubTreeRecord>("TraitSubTree.db2", HotfixStatements.SEL_TRAIT_SUB_TREE, HotfixStatements.SEL_TRAIT_SUB_TREE_LOCALE);
|
||||
TraitSystemStorage = ReadDB2<TraitSystemRecord>("TraitSystem.db2", HotfixStatements.SEL_TRAIT_SYSTEM);
|
||||
TraitTreeStorage = ReadDB2<TraitTreeRecord>("TraitTree.db2", HotfixStatements.SEL_TRAIT_TREE);
|
||||
TraitTreeLoadoutStorage = ReadDB2<TraitTreeLoadoutRecord>("TraitTreeLoadout.db2", HotfixStatements.SEL_TRAIT_TREE_LOADOUT);
|
||||
TraitTreeLoadoutEntryStorage = ReadDB2<TraitTreeLoadoutEntryRecord>("TraitTreeLoadoutEntry.db2", HotfixStatements.SEL_TRAIT_TREE_LOADOUT_ENTRY);
|
||||
@@ -604,6 +608,7 @@ namespace Game.DataStorage
|
||||
public static DB6Storage<ItemBonusTreeRecord> ItemBonusTreeStorage;
|
||||
public static DB6Storage<ItemBonusTreeNodeRecord> ItemBonusTreeNodeStorage;
|
||||
public static DB6Storage<ItemContextPickerEntryRecord> ItemContextPickerEntryStorage;
|
||||
public static DB6Storage<ItemCreationContextRecord> ItemCreationContextStorage;
|
||||
public static DB6Storage<ItemClassRecord> ItemClassStorage;
|
||||
public static DB6Storage<ItemChildEquipmentRecord> ItemChildEquipmentStorage;
|
||||
public static DB6Storage<ItemCurrencyCostRecord> ItemCurrencyCostStorage;
|
||||
@@ -624,7 +629,9 @@ namespace Game.DataStorage
|
||||
public static DB6Storage<ItemModifiedAppearanceRecord> ItemModifiedAppearanceStorage;
|
||||
public static DB6Storage<ItemModifiedAppearanceExtraRecord> ItemModifiedAppearanceExtraStorage;
|
||||
public static DB6Storage<ItemNameDescriptionRecord> ItemNameDescriptionStorage;
|
||||
public static DB6Storage<ItemOffsetCurveRecord> ItemOffsetCurveStorage;
|
||||
public static DB6Storage<ItemPriceBaseRecord> ItemPriceBaseStorage;
|
||||
public static DB6Storage<ItemScalingConfigRecord> ItemScalingConfigStorage;
|
||||
public static DB6Storage<ItemSearchNameRecord> ItemSearchNameStorage;
|
||||
public static DB6Storage<ItemSetRecord> ItemSetStorage;
|
||||
public static DB6Storage<ItemSetSpellRecord> ItemSetSpellStorage;
|
||||
@@ -784,6 +791,7 @@ namespace Game.DataStorage
|
||||
public static DB6Storage<TraitNodeXTraitCostRecord> TraitNodeXTraitCostStorage;
|
||||
public static DB6Storage<TraitNodeXTraitNodeEntryRecord> TraitNodeXTraitNodeEntryStorage;
|
||||
public static DB6Storage<TraitSubTreeRecord> TraitSubTreeStorage;
|
||||
public static DB6Storage<TraitSystemRecord> TraitSystemStorage;
|
||||
public static DB6Storage<TraitTreeRecord> TraitTreeStorage;
|
||||
public static DB6Storage<TraitTreeLoadoutRecord> TraitTreeLoadoutStorage;
|
||||
public static DB6Storage<TraitTreeLoadoutEntryRecord> TraitTreeLoadoutEntryStorage;
|
||||
|
||||
@@ -123,7 +123,7 @@ namespace Game.DataStorage
|
||||
public byte FactionGroupMask;
|
||||
public float AmbientMultiplier;
|
||||
public int MountFlags;
|
||||
public short PvpCombatWorldStateID;
|
||||
public int PvpCombatWorldStateID;
|
||||
public byte WildBattlePetLevelMin;
|
||||
public byte WildBattlePetLevelMax;
|
||||
public byte WindSettingsID;
|
||||
|
||||
@@ -132,7 +132,7 @@ namespace Game.DataStorage
|
||||
public int LanguageID;
|
||||
public int ConditionID;
|
||||
public ushort EmotesID;
|
||||
public ushort Flags;
|
||||
public int Flags;
|
||||
public uint ChatBubbleDurationMs;
|
||||
public int VoiceOverPriorityID;
|
||||
public uint[] SoundKitID = new uint[2];
|
||||
|
||||
@@ -334,13 +334,13 @@ namespace Game.DataStorage
|
||||
public byte OrderIndex;
|
||||
public sbyte PetTalentType;
|
||||
public sbyte Role;
|
||||
public uint Flags;
|
||||
public int Flags;
|
||||
public int SpellIconFileID;
|
||||
public sbyte PrimaryStatPriority;
|
||||
public int AnimReplacements;
|
||||
public uint[] MasterySpellID = new uint[PlayerConst.MaxMasterySpells];
|
||||
|
||||
public bool HasFlag(ChrSpecializationFlag chrSpecializationFlag) { return (Flags & (uint)chrSpecializationFlag) != 0; }
|
||||
public bool HasFlag(ChrSpecializationFlag chrSpecializationFlag) { return (Flags & (int)chrSpecializationFlag) != 0; }
|
||||
public ChrSpecializationRole GetRole() { return (ChrSpecializationRole)Role; }
|
||||
|
||||
public bool IsPetSpecialization()
|
||||
@@ -394,6 +394,8 @@ namespace Game.DataStorage
|
||||
public int DamageItemLevelCurveID;
|
||||
public int HealthPrimaryStatCurveID;
|
||||
public int DamagePrimaryStatCurveID;
|
||||
public int PrimaryStatScalingModPlayerDataElementCharacterID;
|
||||
public float PrimaryStatScalingModPlayerDataElementCharacterMultiplier;
|
||||
public int MinLevel;
|
||||
public int MaxLevel;
|
||||
public int MinLevelType;
|
||||
@@ -698,7 +700,7 @@ namespace Game.DataStorage
|
||||
{
|
||||
public uint Id;
|
||||
public byte Type;
|
||||
public byte Flags;
|
||||
public int Flags;
|
||||
}
|
||||
|
||||
public sealed class CurvePointRecord
|
||||
@@ -707,6 +709,6 @@ namespace Game.DataStorage
|
||||
public Vector2 PreSLSquishPos;
|
||||
public uint Id;
|
||||
public uint CurveID;
|
||||
public byte OrderIndex;
|
||||
public uint OrderIndex;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ namespace Game.DataStorage
|
||||
public byte SheatheType;
|
||||
public sbyte SoundOverrideSubclassID;
|
||||
public int IconFileDataID;
|
||||
public byte ItemGroupSoundsID;
|
||||
public uint ItemGroupSoundsID;
|
||||
public int ContentTuningID;
|
||||
public int ModifiedCraftingReagentItemID;
|
||||
public int CraftingQualityID;
|
||||
@@ -141,6 +141,8 @@ namespace Game.DataStorage
|
||||
public uint IblGroupPointsModSetID;
|
||||
public int MinMythicPlusLevel;
|
||||
public int MaxMythicPlusLevel;
|
||||
public int ItemCreationContextGroupID;
|
||||
public int Flags;
|
||||
public uint ParentItemBonusTreeID;
|
||||
}
|
||||
|
||||
@@ -173,6 +175,13 @@ namespace Game.DataStorage
|
||||
public uint ItemContextPickerID;
|
||||
}
|
||||
|
||||
public sealed class ItemCreationContextRecord
|
||||
{
|
||||
public uint Id;
|
||||
public byte ItemContext;
|
||||
public uint ItemCreationContextGroupID;
|
||||
}
|
||||
|
||||
public sealed class ItemCurrencyCostRecord
|
||||
{
|
||||
public uint Id;
|
||||
@@ -306,6 +315,13 @@ namespace Game.DataStorage
|
||||
public int Color;
|
||||
}
|
||||
|
||||
public sealed class ItemOffsetCurveRecord
|
||||
{
|
||||
public uint Id;
|
||||
public int CurveID;
|
||||
public int Offset;
|
||||
}
|
||||
|
||||
public sealed class ItemPriceBaseRecord
|
||||
{
|
||||
public uint Id;
|
||||
@@ -314,6 +330,15 @@ namespace Game.DataStorage
|
||||
public float Weapon;
|
||||
}
|
||||
|
||||
public sealed class ItemScalingConfigRecord
|
||||
{
|
||||
public uint Id;
|
||||
public int ItemOffsetCurveID;
|
||||
public int ItemLevel;
|
||||
public int RequiredLevel;
|
||||
public int Unknown1125;
|
||||
}
|
||||
|
||||
public sealed class ItemSearchNameRecord
|
||||
{
|
||||
public uint Id;
|
||||
@@ -389,6 +414,8 @@ namespace Game.DataStorage
|
||||
public int ModifiedCraftingReagentItemID;
|
||||
public uint ContentTuningID;
|
||||
public uint PlayerLevelToItemLevelCurveID;
|
||||
public int ItemLevelOffsetCurveID;
|
||||
public int ItemLevelOffsetItemLevel;
|
||||
public ushort ItemNameDescriptionID;
|
||||
public ushort RequiredTransmogHoliday;
|
||||
public ushort RequiredHoliday;
|
||||
|
||||
@@ -146,7 +146,7 @@ namespace Game.DataStorage
|
||||
public uint[] Time = new uint[2];
|
||||
public uint[] AuraSpellID = new uint[4];
|
||||
public byte[] AuraStacks = new byte[4];
|
||||
public ushort[] Achievement = new ushort[4];
|
||||
public uint[] Achievement = new uint[4];
|
||||
public ushort[] AreaID = new ushort[4];
|
||||
public byte[] LfgStatus = new byte[4];
|
||||
public byte[] LfgCompare = new byte[4];
|
||||
@@ -165,6 +165,7 @@ namespace Game.DataStorage
|
||||
public uint Id;
|
||||
public int StorageIndex;
|
||||
public int Type;
|
||||
public int Unknown1125;
|
||||
|
||||
public PlayerDataElementType GetElementType() { return (PlayerDataElementType)Type; }
|
||||
}
|
||||
@@ -174,6 +175,7 @@ namespace Game.DataStorage
|
||||
public uint Id;
|
||||
public int StorageIndex;
|
||||
public int Type;
|
||||
public int Unknown1125;
|
||||
|
||||
public PlayerDataElementType GetElementType() { return (PlayerDataElementType)Type; }
|
||||
}
|
||||
@@ -183,6 +185,7 @@ namespace Game.DataStorage
|
||||
public uint Id;
|
||||
public int StorageIndex;
|
||||
public int Unknown1107;
|
||||
public int Unknown1125;
|
||||
}
|
||||
|
||||
public sealed class PlayerDataFlagCharacterRecord
|
||||
@@ -190,6 +193,7 @@ namespace Game.DataStorage
|
||||
public uint Id;
|
||||
public int StorageIndex;
|
||||
public int Unknown1107;
|
||||
public int Unknown1125;
|
||||
}
|
||||
|
||||
public sealed class PowerDisplayRecord
|
||||
|
||||
@@ -43,8 +43,8 @@ namespace Game.DataStorage
|
||||
public sealed class SceneScriptRecord
|
||||
{
|
||||
public uint Id;
|
||||
public ushort FirstSceneScriptID;
|
||||
public ushort NextSceneScriptID;
|
||||
public uint FirstSceneScriptID;
|
||||
public uint NextSceneScriptID;
|
||||
public int Unknown915;
|
||||
}
|
||||
|
||||
@@ -244,10 +244,10 @@ namespace Game.DataStorage
|
||||
public uint Id;
|
||||
public byte DifficultyID;
|
||||
public ushort Category;
|
||||
public sbyte DefenseType;
|
||||
public int DefenseType;
|
||||
public sbyte DispelType;
|
||||
public sbyte Mechanic;
|
||||
public sbyte PreventionType;
|
||||
public int PreventionType;
|
||||
public ushort StartRecoveryCategory;
|
||||
public ushort ChargeCategory;
|
||||
public uint SpellID;
|
||||
@@ -361,7 +361,7 @@ namespace Game.DataStorage
|
||||
{
|
||||
public uint Id;
|
||||
public byte DifficultyID;
|
||||
public short InterruptFlags;
|
||||
public int InterruptFlags;
|
||||
public int[] AuraInterruptFlags = new int[2];
|
||||
public int[] ChannelInterruptFlags = new int[2];
|
||||
public uint SpellID;
|
||||
|
||||
@@ -143,6 +143,7 @@ namespace Game.DataStorage
|
||||
public uint Id;
|
||||
public int Amount;
|
||||
public int TraitCurrencyID;
|
||||
public int CurveID;
|
||||
}
|
||||
|
||||
public sealed class TraitCurrencyRecord
|
||||
@@ -152,6 +153,8 @@ namespace Game.DataStorage
|
||||
public int CurrencyTypesID;
|
||||
public int Flags;
|
||||
public int Icon;
|
||||
public int PlayerDataElementAccountID;
|
||||
public int PlayerDataElementCharacterID;
|
||||
|
||||
public TraitCurrencyType GetCurrencyType() { return (TraitCurrencyType)Type; }
|
||||
}
|
||||
@@ -294,11 +297,23 @@ namespace Game.DataStorage
|
||||
{
|
||||
public LocalizedString Name;
|
||||
public LocalizedString Description;
|
||||
public uint ID;
|
||||
public uint Id;
|
||||
public int UiTextureAtlasElementID;
|
||||
public uint TraitTreeID; // Parent tree
|
||||
}
|
||||
|
||||
public sealed class TraitSystemRecord
|
||||
{
|
||||
public uint Id;
|
||||
public int Flags;
|
||||
public int WidgetSetID;
|
||||
public int TraitChangeSpell;
|
||||
public int ItemID;
|
||||
public int VariationType;
|
||||
|
||||
public TraitSystemVariationType GetVariationType() { return (TraitSystemVariationType)VariationType; }
|
||||
}
|
||||
|
||||
public sealed class TraitTreeRecord
|
||||
{
|
||||
public uint Id;
|
||||
|
||||
@@ -40,6 +40,7 @@ namespace Game.DataStorage
|
||||
public int AreaID;
|
||||
public int WmoDoodadPlacementID;
|
||||
public int WmoGroupID;
|
||||
public int Unknown1125;
|
||||
}
|
||||
|
||||
public sealed class UiMapLinkRecord
|
||||
|
||||
@@ -169,7 +169,7 @@ namespace Game.Entities
|
||||
}
|
||||
|
||||
VisualAnim visualAnim = areaTriggerData.ModifyValue(m_areaTriggerData.VisualAnim);
|
||||
SetUpdateFieldValue(visualAnim.ModifyValue(visualAnim.AnimationDataID), GetCreateProperties().AnimId);
|
||||
SetUpdateFieldValue(visualAnim.ModifyValue(visualAnim.AnimationDataID), (ushort)GetCreateProperties().AnimId);
|
||||
SetUpdateFieldValue(visualAnim.ModifyValue(visualAnim.AnimKitID), GetCreateProperties().AnimKitId);
|
||||
if (GetCreateProperties() != null && GetCreateProperties().Flags.HasFlag(AreaTriggerCreatePropertiesFlag.VisualAnimIsDecay))
|
||||
SetUpdateFieldValue(visualAnim.ModifyValue(visualAnim.IsDecay), true);
|
||||
|
||||
@@ -36,7 +36,7 @@ namespace Game.Entities
|
||||
|
||||
TrainerList trainerList = new();
|
||||
trainerList.TrainerGUID = npc.GetGUID();
|
||||
trainerList.TrainerType = (int)_type;
|
||||
trainerList.TrainerType = (sbyte)_type;
|
||||
trainerList.TrainerID = (int)_id;
|
||||
trainerList.Greeting = GetGreeting(locale);
|
||||
|
||||
|
||||
@@ -15,6 +15,11 @@ namespace Game.Entities
|
||||
T GetValue();
|
||||
}
|
||||
|
||||
public interface IsUpdateFieldStructureTag<T>
|
||||
{
|
||||
void WriteCreate(WorldPacket data, T owner, Player receiver);
|
||||
void WriteUpdate(WorldPacket data, bool ignoreChangesMask, T owner, Player receiver);
|
||||
}
|
||||
public interface IHasChangesMask
|
||||
{
|
||||
void ClearChangesMask();
|
||||
@@ -184,25 +189,18 @@ namespace Game.Entities
|
||||
|
||||
public class DynamicUpdateField<T> where T : new()
|
||||
{
|
||||
public List<T> _values;
|
||||
public List<uint> _updateMask;
|
||||
public List<T> _values = new();
|
||||
public List<uint> _updateMask = new();
|
||||
public int BlockBit;
|
||||
public int Bit;
|
||||
|
||||
public DynamicUpdateField()
|
||||
{
|
||||
_values = new List<T>();
|
||||
_updateMask = new List<uint>();
|
||||
|
||||
BlockBit = -1;
|
||||
Bit = -1;
|
||||
}
|
||||
|
||||
public DynamicUpdateField(int blockBit, int bit)
|
||||
{
|
||||
_values = new List<T>();
|
||||
_updateMask = new List<uint>();
|
||||
|
||||
BlockBit = blockBit;
|
||||
Bit = bit;
|
||||
}
|
||||
@@ -353,6 +351,81 @@ namespace Game.Entities
|
||||
}
|
||||
}
|
||||
|
||||
public enum MapUpdateFieldState
|
||||
{
|
||||
Unchanged = 0,
|
||||
Changed = 1,
|
||||
Deleted = 2
|
||||
}
|
||||
|
||||
public class MapUpdateField<K, V> where V : new()
|
||||
{
|
||||
Dictionary<K, (V, MapUpdateFieldState)> _values = new();
|
||||
public int BlockBit;
|
||||
public int Bit;
|
||||
|
||||
public MapUpdateField(int blockBit, int bit)
|
||||
{
|
||||
BlockBit = blockBit;
|
||||
Bit = bit;
|
||||
}
|
||||
|
||||
public bool Empty()
|
||||
{
|
||||
return _values.Empty();
|
||||
}
|
||||
|
||||
public int Size()
|
||||
{
|
||||
return _values.Count;
|
||||
}
|
||||
|
||||
public void TryAdd(K key)
|
||||
{
|
||||
if (!_values.ContainsKey(key))
|
||||
_values[key] = (new V(), MapUpdateFieldState.Changed);
|
||||
}
|
||||
|
||||
public void Remove(K key)
|
||||
{
|
||||
_values.Remove(key);
|
||||
}
|
||||
|
||||
public void MarkKeyForRemoval(K key)
|
||||
{
|
||||
var itr = _values.LookupByKey(key);
|
||||
if (itr.Item1 != null)
|
||||
itr.Item2 = MapUpdateFieldState.Deleted;
|
||||
}
|
||||
|
||||
public (V, MapUpdateFieldState) Get(K key)
|
||||
{
|
||||
if (_values.TryGetValue(key, out var value))
|
||||
return value;
|
||||
|
||||
return default;
|
||||
}
|
||||
|
||||
public (K, V) FindIf(Predicate<V> predicate)
|
||||
{
|
||||
var itr = _values.First(pair => { return predicate(pair.Value.Item1); });
|
||||
if (itr.Key != null)
|
||||
return (itr.Key, itr.Value.Item1);
|
||||
|
||||
return default;
|
||||
}
|
||||
|
||||
public IEnumerator<KeyValuePair<K, (V, MapUpdateFieldState)>> GetEnumerator()
|
||||
{
|
||||
foreach (var obj in _values)
|
||||
yield return obj;
|
||||
}
|
||||
|
||||
public List<K> GetKeys() { return _values.Keys.ToList(); }
|
||||
|
||||
public List<(V, MapUpdateFieldState)> GetValues() { return _values.Values.ToList(); }
|
||||
}
|
||||
|
||||
public class VariantUpdateField(int blockBit, int bit)
|
||||
{
|
||||
public object _value;
|
||||
@@ -435,6 +508,33 @@ namespace Game.Entities
|
||||
|
||||
public void ClearChangesMask(UpdateFieldString updateField) { }
|
||||
|
||||
public void ClearChangesMask<K, V>(MapUpdateField<K, V> field) where V : new()
|
||||
{
|
||||
foreach (var key in field.GetKeys())
|
||||
{
|
||||
var value = field.Get(key);
|
||||
switch (value.Item2)
|
||||
{
|
||||
case MapUpdateFieldState.Unchanged:
|
||||
break;
|
||||
case MapUpdateFieldState.Changed:
|
||||
if (typeof(HasChangesMask).IsAssignableFrom(typeof(K)))
|
||||
((IHasChangesMask)key).ClearChangesMask();
|
||||
|
||||
if (typeof(HasChangesMask).IsAssignableFrom(typeof(V)))
|
||||
((IHasChangesMask)value.Item1).ClearChangesMask();
|
||||
|
||||
value.Item2 = MapUpdateFieldState.Unchanged;
|
||||
break;
|
||||
case MapUpdateFieldState.Deleted:
|
||||
field.Remove(key);
|
||||
continue;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void ClearChangesMask<U>(OptionalUpdateField<U> updateField) where U : new()
|
||||
{
|
||||
if (typeof(IHasChangesMask).IsAssignableFrom(typeof(U)) && updateField.HasValue())
|
||||
@@ -488,6 +588,19 @@ namespace Game.Entities
|
||||
return updateField;
|
||||
}
|
||||
|
||||
public MapUpdateField<K, V> ModifyValue<K, V>(MapUpdateField<K, V> updateField) where V : new()
|
||||
{
|
||||
MarkChanged(updateField);
|
||||
return updateField;
|
||||
}
|
||||
|
||||
public V ModifyValue<K, V>(MapUpdateField<K, V> updateField, K key) where V : new()
|
||||
{
|
||||
MarkChanged(updateField);
|
||||
updateField.TryAdd(key);
|
||||
return updateField.Get(key).Item1;
|
||||
}
|
||||
|
||||
public OptionalUpdateField<U> ModifyValue<U>(OptionalUpdateField<U> updateField) where U : new()
|
||||
{
|
||||
MarkChanged(updateField);
|
||||
@@ -565,6 +678,14 @@ namespace Game.Entities
|
||||
_changesMask.Set(updateField.Bit);
|
||||
}
|
||||
|
||||
public void MarkChanged<K, V>(MapUpdateField<K, V> updateField) where V : new()
|
||||
{
|
||||
if (updateField.BlockBit >= 0)
|
||||
_changesMask.Set(updateField.BlockBit);
|
||||
|
||||
_changesMask.Set(updateField.Bit);
|
||||
}
|
||||
|
||||
public void MarkChanged<U>(OptionalUpdateField<U> updateField) where U : new()
|
||||
{
|
||||
_changesMask.Set(updateField.BlockBit);
|
||||
@@ -613,6 +734,60 @@ namespace Game.Entities
|
||||
data.WriteBits(0xFFFFFFFFu, size % 32);
|
||||
}
|
||||
|
||||
public void WriteMapFieldCreate<K, V, T>(MapUpdateField<K, V> map, WorldPacket data, T owner, Player receiver) where V : new()
|
||||
{
|
||||
data.WriteInt32(map.Size());
|
||||
foreach (var (k, (v, _)) in map)
|
||||
{
|
||||
if (typeof(IsUpdateFieldStructureTag<T>).IsAssignableFrom(typeof(K)))
|
||||
((IsUpdateFieldStructureTag<T>)k).WriteCreate(data, owner, receiver);
|
||||
else
|
||||
data.Write(k);
|
||||
|
||||
if (typeof(IsUpdateFieldStructureTag<T>).IsAssignableFrom(typeof(V)))
|
||||
((IsUpdateFieldStructureTag<T>)v).WriteCreate(data, owner, receiver);
|
||||
else
|
||||
data.Write(v);
|
||||
}
|
||||
}
|
||||
|
||||
public void WriteMapFieldUpdate<K, V, T>(MapUpdateField<K, V> map, WorldPacket data, bool ignoreChangesMask, T owner, Player receiver) where V : new()
|
||||
{
|
||||
data.WriteUInt8((byte)(ignoreChangesMask ? 1 : 0));
|
||||
if (ignoreChangesMask)
|
||||
WriteMapFieldCreate(map, data, owner, receiver);
|
||||
else
|
||||
{
|
||||
ushort changesCount = 0;
|
||||
WorldPacket tempBuffer = new();
|
||||
|
||||
foreach (var (k, (v, state)) in map)
|
||||
{
|
||||
if (state == MapUpdateFieldState.Unchanged)
|
||||
continue;
|
||||
|
||||
++changesCount;
|
||||
|
||||
if (typeof(IsUpdateFieldStructureTag<T>).IsAssignableFrom(typeof(K)))
|
||||
((IsUpdateFieldStructureTag<T>)k).WriteUpdate(tempBuffer, true /*ignoreChangesMask*/, owner, receiver);
|
||||
else
|
||||
tempBuffer.Write(k);
|
||||
|
||||
tempBuffer.WriteUInt8((byte)state);
|
||||
if (state == MapUpdateFieldState.Deleted)
|
||||
continue;
|
||||
|
||||
if (typeof(IsUpdateFieldStructureTag<T>).IsAssignableFrom(typeof(V)))
|
||||
((IsUpdateFieldStructureTag<T>)v).WriteUpdate(tempBuffer, true /*ignoreChangesMask*/, owner, receiver); // client bug replaces unchanged values with 0/default so send everything as if it changed
|
||||
else
|
||||
tempBuffer.Write(v);
|
||||
}
|
||||
|
||||
data.WriteUInt16(changesCount);
|
||||
data.WriteBytes(tempBuffer);
|
||||
}
|
||||
}
|
||||
|
||||
public UpdateMask GetStaticUpdateMask()
|
||||
{
|
||||
return new UpdateMask(ChangeMaskLength);
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -844,6 +844,12 @@ namespace Game.Entities
|
||||
updateField.RemoveValue(index);
|
||||
}
|
||||
|
||||
public void RemoveMapUpdateFieldValue<K, V>(MapUpdateField<K, V> setter, K key) where V : new()
|
||||
{
|
||||
AddToObjectUpdateIfNeeded();
|
||||
setter.MarkKeyForRemoval(key);
|
||||
}
|
||||
|
||||
public void ClearDynamicUpdateFieldValues<T>(DynamicUpdateField<T> updateField) where T : new()
|
||||
{
|
||||
AddToObjectUpdateIfNeeded();
|
||||
|
||||
@@ -1175,8 +1175,8 @@ namespace Game.Entities
|
||||
|
||||
if (!configsResult.IsEmpty())
|
||||
{
|
||||
// 0 1 2 3 4 5 6 7
|
||||
// SELECT traitConfigId, type, chrSpecializationId, combatConfigFlags, localIdentifier, skillLineId, traitSystemId, `name` FROM character_trait_config WHERE guid = ?
|
||||
// 0 1 2 3 4 5 6 7 8
|
||||
// SELECT traitConfigId, type, chrSpecializationId, combatConfigFlags, localIdentifier, skillLineId, traitSystemId, variationId, `name` FROM character_trait_config WHERE guid = ?
|
||||
do
|
||||
{
|
||||
TraitConfigPacket traitConfig = new();
|
||||
@@ -1194,12 +1194,13 @@ namespace Game.Entities
|
||||
break;
|
||||
case TraitConfigType.Generic:
|
||||
traitConfig.TraitSystemID = configsResult.Read<uint>(6);
|
||||
traitConfig.VariationID = configsResult.Read<int>(7);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
traitConfig.Name = configsResult.Read<string>(7);
|
||||
traitConfig.Name = configsResult.Read<string>(8);
|
||||
|
||||
foreach (var grantedEntry in TraitMgr.GetGrantedTraitEntriesForConfig(traitConfig, this))
|
||||
traitConfig.Entries.Add(new TraitEntryPacket(grantedEntry));
|
||||
@@ -1242,23 +1243,23 @@ namespace Game.Entities
|
||||
|
||||
bool hasConfigForSpec(int specId)
|
||||
{
|
||||
return m_activePlayerData.TraitConfigs.FindIndexIf(traitConfig =>
|
||||
return m_activePlayerData.TraitConfigs.FindIf(traitConfig =>
|
||||
{
|
||||
return traitConfig.Type == (int)TraitConfigType.Combat
|
||||
&& traitConfig.ChrSpecializationID == specId
|
||||
&& (traitConfig.CombatConfigFlags & (int)TraitCombatConfigFlags.ActiveForSpec) != 0;
|
||||
}) >= 0;
|
||||
}).Item1 != 0;
|
||||
}
|
||||
|
||||
int findFreeLocalIdentifier(int specId)
|
||||
{
|
||||
int index = 1;
|
||||
while (m_activePlayerData.TraitConfigs.FindIndexIf(traitConfig =>
|
||||
while (m_activePlayerData.TraitConfigs.FindIf(traitConfig =>
|
||||
{
|
||||
return traitConfig.Type == (int)TraitConfigType.Combat
|
||||
&& traitConfig.ChrSpecializationID == specId
|
||||
&& traitConfig.LocalIdentifier == index;
|
||||
}) >= 0)
|
||||
}).Item1 != 0)
|
||||
++index;
|
||||
|
||||
return index;
|
||||
@@ -1283,23 +1284,22 @@ namespace Game.Entities
|
||||
}
|
||||
}
|
||||
|
||||
int activeConfig = m_activePlayerData.TraitConfigs.FindIndexIf(traitConfig =>
|
||||
TraitConfig activeTraitConfig = m_activePlayerData.TraitConfigs.FindIf(traitConfig =>
|
||||
{
|
||||
return traitConfig.Type == (int)TraitConfigType.Combat
|
||||
&& traitConfig.ChrSpecializationID == (int)GetPrimarySpecialization()
|
||||
&& (traitConfig.CombatConfigFlags & (int)TraitCombatConfigFlags.ActiveForSpec) != 0;
|
||||
});
|
||||
}).Item2;
|
||||
|
||||
if (activeConfig >= 0)
|
||||
if (activeTraitConfig != null)
|
||||
{
|
||||
TraitConfig activeTraitConfig = m_activePlayerData.TraitConfigs[activeConfig];
|
||||
SetActiveCombatTraitConfigID(activeTraitConfig.ID);
|
||||
int activeSubTree = activeTraitConfig.SubTrees.FindIndexIf(subTree => subTree.Active != 0);
|
||||
if (activeSubTree >= 0)
|
||||
SetCurrentCombatTraitConfigSubTreeID(activeTraitConfig.SubTrees[activeSubTree].TraitSubTreeID);
|
||||
}
|
||||
|
||||
foreach (TraitConfig traitConfig in m_activePlayerData.TraitConfigs)
|
||||
foreach (var (id, (traitConfig, _)) in m_activePlayerData.TraitConfigs)
|
||||
{
|
||||
switch ((TraitConfigType)(int)traitConfig.Type)
|
||||
{
|
||||
@@ -1315,7 +1315,7 @@ namespace Game.Entities
|
||||
break;
|
||||
}
|
||||
|
||||
ApplyTraitConfig(traitConfig.ID, true);
|
||||
ApplyTraitConfig(id, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2138,16 +2138,16 @@ namespace Game.Entities
|
||||
TraitConfig traitConfig = GetTraitConfig((int)(uint)m_activePlayerData.ActiveCombatTraitConfigID);
|
||||
if (traitConfig != null)
|
||||
{
|
||||
int usedSavedTraitConfigIndex = m_activePlayerData.TraitConfigs.FindIndexIf(savedConfig =>
|
||||
int usedSavedTraitConfigId = m_activePlayerData.TraitConfigs.FindIf(savedConfig =>
|
||||
{
|
||||
return (TraitConfigType)(int)savedConfig.Type == TraitConfigType.Combat
|
||||
&& ((TraitCombatConfigFlags)(int)savedConfig.CombatConfigFlags & TraitCombatConfigFlags.ActiveForSpec) == TraitCombatConfigFlags.None
|
||||
&& ((TraitCombatConfigFlags)(int)savedConfig.CombatConfigFlags & TraitCombatConfigFlags.SharedActionBars) == TraitCombatConfigFlags.None
|
||||
&& savedConfig.LocalIdentifier == traitConfig.LocalIdentifier;
|
||||
});
|
||||
}).Item1;
|
||||
|
||||
if (usedSavedTraitConfigIndex >= 0)
|
||||
traitConfigId = m_activePlayerData.TraitConfigs[usedSavedTraitConfigIndex].ID;
|
||||
if (usedSavedTraitConfigId != 0)
|
||||
traitConfigId = usedSavedTraitConfigId;
|
||||
}
|
||||
|
||||
PreparedStatement stmt;
|
||||
@@ -2480,6 +2480,7 @@ namespace Game.Entities
|
||||
stmt.AddValue(5, traitConfig.LocalIdentifier);
|
||||
stmt.AddNull(6);
|
||||
stmt.AddNull(7);
|
||||
stmt.AddNull(8);
|
||||
break;
|
||||
case TraitConfigType.Profession:
|
||||
stmt.AddNull(3);
|
||||
@@ -2487,6 +2488,7 @@ namespace Game.Entities
|
||||
stmt.AddNull(5);
|
||||
stmt.AddValue(6, traitConfig.SkillLineID);
|
||||
stmt.AddNull(7);
|
||||
stmt.AddNull(8);
|
||||
break;
|
||||
case TraitConfigType.Generic:
|
||||
stmt.AddNull(3);
|
||||
@@ -2494,12 +2496,13 @@ namespace Game.Entities
|
||||
stmt.AddNull(5);
|
||||
stmt.AddNull(6);
|
||||
stmt.AddValue(7, traitConfig.TraitSystemID);
|
||||
stmt.AddValue(8, traitConfig.VariationID);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
stmt.AddValue(8, traitConfig.Name);
|
||||
stmt.AddValue(9, traitConfig.Name);
|
||||
trans.Append(stmt);
|
||||
|
||||
foreach (var traitEntry in traitConfig.Entries)
|
||||
|
||||
@@ -2337,7 +2337,7 @@ namespace Game.Entities
|
||||
{
|
||||
var questLogField = m_values.ModifyValue(m_playerData).ModifyValue(m_playerData.QuestLog, slot);
|
||||
SetUpdateFieldValue(questLogField.ModifyValue(questLogField.QuestID), quest_id);
|
||||
SetUpdateFieldValue(questLogField.ModifyValue(questLogField.StateFlags), 0u);
|
||||
SetUpdateFieldValue(questLogField.ModifyValue(questLogField.StateFlags), (ushort)0);
|
||||
SetUpdateFieldValue(questLogField.ModifyValue(questLogField.EndTime), 0u);
|
||||
SetUpdateFieldValue(questLogField.ModifyValue(questLogField.ObjectiveFlags), 0u);
|
||||
|
||||
@@ -2358,13 +2358,13 @@ namespace Game.Entities
|
||||
public void SetQuestSlotState(ushort slot, QuestSlotStateMask state)
|
||||
{
|
||||
QuestLog questLogField = m_values.ModifyValue(m_playerData).ModifyValue(m_playerData.QuestLog, slot);
|
||||
SetUpdateFieldFlagValue(questLogField.ModifyValue(questLogField.StateFlags), (uint)state);
|
||||
SetUpdateFieldFlagValue(questLogField.ModifyValue(questLogField.StateFlags), (ushort)state);
|
||||
}
|
||||
|
||||
public void RemoveQuestSlotState(ushort slot, QuestSlotStateMask state)
|
||||
{
|
||||
QuestLog questLogField = m_values.ModifyValue(m_playerData).ModifyValue(m_playerData.QuestLog, slot);
|
||||
RemoveUpdateFieldFlagValue(questLogField.ModifyValue(questLogField.StateFlags), (uint)state);
|
||||
RemoveUpdateFieldFlagValue(questLogField.ModifyValue(questLogField.StateFlags), (ushort)state);
|
||||
}
|
||||
|
||||
public void SetQuestSlotEndTime(ushort slot, long endTime)
|
||||
|
||||
@@ -358,19 +358,19 @@ namespace Game.Entities
|
||||
|
||||
SetActiveTalentGroup(spec.OrderIndex);
|
||||
SetPrimarySpecialization(spec.Id);
|
||||
int specTraitConfigIndex = m_activePlayerData.TraitConfigs.FindIndexIf(traitConfig =>
|
||||
var specTraitConfig = m_activePlayerData.TraitConfigs.FindIf(traitConfig =>
|
||||
{
|
||||
return (TraitConfigType)(int)traitConfig.Type == TraitConfigType.Combat
|
||||
&& traitConfig.ChrSpecializationID == spec.Id
|
||||
&& ((TraitCombatConfigFlags)(int)traitConfig.CombatConfigFlags & TraitCombatConfigFlags.ActiveForSpec) != TraitCombatConfigFlags.None;
|
||||
});
|
||||
if (specTraitConfigIndex >= 0)
|
||||
}).Item2;
|
||||
|
||||
if (specTraitConfig != null)
|
||||
{
|
||||
TraitConfig activeTraitConfig = m_activePlayerData.TraitConfigs[specTraitConfigIndex];
|
||||
SetActiveCombatTraitConfigID(activeTraitConfig.ID);
|
||||
int activeSubTree = activeTraitConfig.SubTrees.FindIndexIf(subTree => subTree.Active != 0);
|
||||
SetActiveCombatTraitConfigID(specTraitConfig.ID);
|
||||
int activeSubTree = specTraitConfig.SubTrees.FindIndexIf(subTree => subTree.Active != 0);
|
||||
if (activeSubTree >= 0)
|
||||
SetCurrentCombatTraitConfigSubTreeID(activeTraitConfig.SubTrees[activeSubTree].TraitSubTreeID);
|
||||
SetCurrentCombatTraitConfigSubTreeID(specTraitConfig.SubTrees[activeSubTree].TraitSubTreeID);
|
||||
else
|
||||
SetCurrentCombatTraitConfigSubTreeID(0);
|
||||
}
|
||||
@@ -497,16 +497,16 @@ namespace Game.Entities
|
||||
TraitConfig traitConfig = GetTraitConfig((int)(uint)m_activePlayerData.ActiveCombatTraitConfigID);
|
||||
if (traitConfig != null)
|
||||
{
|
||||
int usedSavedTraitConfigIndex = m_activePlayerData.TraitConfigs.FindIndexIf(savedConfig =>
|
||||
var usedSavedTraitConfigId = m_activePlayerData.TraitConfigs.FindIf(savedConfig =>
|
||||
{
|
||||
return (TraitConfigType)(int)savedConfig.Type == TraitConfigType.Combat
|
||||
&& ((TraitCombatConfigFlags)(int)savedConfig.CombatConfigFlags & TraitCombatConfigFlags.ActiveForSpec) == TraitCombatConfigFlags.None
|
||||
&& ((TraitCombatConfigFlags)(int)savedConfig.CombatConfigFlags & TraitCombatConfigFlags.SharedActionBars) == TraitCombatConfigFlags.None
|
||||
&& savedConfig.LocalIdentifier == traitConfig.LocalIdentifier;
|
||||
});
|
||||
}).Item1;
|
||||
|
||||
if (usedSavedTraitConfigIndex >= 0)
|
||||
traitConfigId = (uint)(int)m_activePlayerData.TraitConfigs[usedSavedTraitConfigIndex].ID;
|
||||
if (usedSavedTraitConfigId != 0)
|
||||
traitConfigId = (uint)usedSavedTraitConfigId;
|
||||
}
|
||||
|
||||
// load them asynchronously
|
||||
@@ -873,45 +873,38 @@ namespace Game.Entities
|
||||
public void CreateTraitConfig(TraitConfigPacket traitConfig)
|
||||
{
|
||||
int configId = TraitMgr.GenerateNewTraitConfigId();
|
||||
bool hasConfigId(int id)
|
||||
{
|
||||
return m_activePlayerData.TraitConfigs.FindIndexIf(config => config.ID == id) >= 0;
|
||||
}
|
||||
bool hasConfigId(int id) => m_activePlayerData.TraitConfigs.Get(id).Item1 != null;
|
||||
|
||||
while (hasConfigId(configId))
|
||||
configId = TraitMgr.GenerateNewTraitConfigId();
|
||||
|
||||
traitConfig.ID = configId;
|
||||
|
||||
int traitConfigIndex = m_activePlayerData.TraitConfigs.Size();
|
||||
AddTraitConfig(traitConfig);
|
||||
|
||||
TraitConfig entrySetter = m_values.ModifyValue(m_activePlayerData).ModifyValue(m_activePlayerData.TraitConfigs, configId);
|
||||
foreach (TraitEntry grantedEntry in TraitMgr.GetGrantedTraitEntriesForConfig(traitConfig, this))
|
||||
{
|
||||
var entryIndex = traitConfig.Entries.Find(entry => entry.TraitNodeID == grantedEntry.TraitNodeID && entry.TraitNodeEntryID == grantedEntry.TraitNodeEntryID);
|
||||
if (entryIndex == null)
|
||||
{
|
||||
TraitConfig value = m_values.ModifyValue(m_activePlayerData).ModifyValue(m_activePlayerData.TraitConfigs, traitConfigIndex);
|
||||
AddDynamicUpdateFieldValue(value.ModifyValue(value.Entries), grantedEntry);
|
||||
}
|
||||
AddDynamicUpdateFieldValue(entrySetter.ModifyValue(entrySetter.Entries), grantedEntry);
|
||||
}
|
||||
|
||||
m_traitConfigStates[(int)configId] = PlayerSpellState.Changed;
|
||||
m_traitConfigStates[configId] = PlayerSpellState.Changed;
|
||||
}
|
||||
|
||||
void AddTraitConfig(TraitConfigPacket traitConfig)
|
||||
{
|
||||
var setter = new TraitConfig();
|
||||
setter.ModifyValue(setter.ID).SetValue(traitConfig.ID);
|
||||
setter.ModifyValue(setter.Name).SetValue(traitConfig.Name);
|
||||
setter.ModifyValue(setter.Type).SetValue((int)traitConfig.Type);
|
||||
setter.ModifyValue(setter.SkillLineID).SetValue((int)traitConfig.SkillLineID);
|
||||
setter.ModifyValue(setter.ChrSpecializationID).SetValue(traitConfig.ChrSpecializationID);
|
||||
setter.ModifyValue(setter.CombatConfigFlags).SetValue((int)traitConfig.CombatConfigFlags);
|
||||
setter.ModifyValue(setter.LocalIdentifier).SetValue(traitConfig.LocalIdentifier);
|
||||
setter.ModifyValue(setter.TraitSystemID).SetValue(traitConfig.TraitSystemID);
|
||||
|
||||
AddDynamicUpdateFieldValue(m_values.ModifyValue(m_activePlayerData).ModifyValue(m_activePlayerData.TraitConfigs), setter);
|
||||
var setter = m_values.ModifyValue(m_activePlayerData).ModifyValue(m_activePlayerData.TraitConfigs, traitConfig.ID);
|
||||
SetUpdateFieldValue(setter.ModifyValue(setter.ID), traitConfig.ID);
|
||||
SetUpdateFieldValue(setter.ModifyValue(setter.Name), traitConfig.Name);
|
||||
SetUpdateFieldValue(setter.ModifyValue(setter.Type), (int)traitConfig.Type);
|
||||
SetUpdateFieldValue(setter.ModifyValue(setter.SkillLineID), (int)traitConfig.SkillLineID);
|
||||
SetUpdateFieldValue(setter.ModifyValue(setter.ChrSpecializationID), traitConfig.ChrSpecializationID);
|
||||
SetUpdateFieldValue(setter.ModifyValue(setter.CombatConfigFlags), (int)traitConfig.CombatConfigFlags);
|
||||
SetUpdateFieldValue(setter.ModifyValue(setter.LocalIdentifier), traitConfig.LocalIdentifier);
|
||||
SetUpdateFieldValue(setter.ModifyValue(setter.TraitSystemID), traitConfig.TraitSystemID);
|
||||
|
||||
foreach (TraitEntryPacket traitEntry in traitConfig.Entries)
|
||||
{
|
||||
@@ -945,17 +938,13 @@ namespace Game.Entities
|
||||
|
||||
public TraitConfig GetTraitConfig(int configId)
|
||||
{
|
||||
int index = m_activePlayerData.TraitConfigs.FindIndexIf(config => config.ID == configId);
|
||||
if (index < 0)
|
||||
return null;
|
||||
|
||||
return m_activePlayerData.TraitConfigs[index];
|
||||
return m_activePlayerData.TraitConfigs.Get(configId).Item1;
|
||||
}
|
||||
|
||||
public void UpdateTraitConfig(TraitConfigPacket newConfig, int savedConfigId, bool withCastTime)
|
||||
{
|
||||
int index = m_activePlayerData.TraitConfigs.FindIndexIf(config => config.ID == newConfig.ID);
|
||||
if (index < 0)
|
||||
var oldConfig = m_activePlayerData.TraitConfigs.Get(newConfig.ID).Item1;
|
||||
if (oldConfig == null)
|
||||
return;
|
||||
|
||||
if (withCastTime)
|
||||
@@ -966,14 +955,14 @@ namespace Game.Entities
|
||||
|
||||
bool isActiveConfig = true;
|
||||
bool loadActionButtons = false;
|
||||
switch ((TraitConfigType)(int)m_activePlayerData.TraitConfigs[index].Type)
|
||||
switch ((TraitConfigType)(int)oldConfig.Type)
|
||||
{
|
||||
case TraitConfigType.Combat:
|
||||
isActiveConfig = newConfig.ID == m_activePlayerData.ActiveCombatTraitConfigID;
|
||||
loadActionButtons = m_activePlayerData.TraitConfigs[index].LocalIdentifier != newConfig.LocalIdentifier;
|
||||
loadActionButtons = oldConfig.LocalIdentifier != newConfig.LocalIdentifier;
|
||||
break;
|
||||
case TraitConfigType.Profession:
|
||||
isActiveConfig = HasSkill((uint)(int)m_activePlayerData.TraitConfigs[index].SkillLineID);
|
||||
isActiveConfig = HasSkill((uint)(int)oldConfig.SkillLineID);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -981,7 +970,7 @@ namespace Game.Entities
|
||||
|
||||
Action finalizeTraitConfigUpdate = () =>
|
||||
{
|
||||
TraitConfig newTraitConfig = m_values.ModifyValue(m_activePlayerData).ModifyValue(m_activePlayerData.TraitConfigs, index);
|
||||
TraitConfig newTraitConfig = m_values.ModifyValue(m_activePlayerData).ModifyValue(m_activePlayerData.TraitConfigs, newConfig.ID);
|
||||
SetUpdateFieldValue(newTraitConfig.ModifyValue(newTraitConfig.LocalIdentifier), newConfig.LocalIdentifier);
|
||||
|
||||
ApplyTraitEntryChanges(newConfig.ID, newConfig, isActiveConfig, true);
|
||||
@@ -1007,11 +996,11 @@ namespace Game.Entities
|
||||
|
||||
void ApplyTraitEntryChanges(int editedConfigId, TraitConfigPacket newConfig, bool applyTraits, bool consumeCurrencies)
|
||||
{
|
||||
int editedIndex = m_activePlayerData.TraitConfigs.FindIndexIf(config => config.ID == editedConfigId);
|
||||
if (editedIndex < 0)
|
||||
var editedConfig = m_activePlayerData.TraitConfigs.Get(editedConfigId).Item1;
|
||||
if (editedConfig == null)
|
||||
return;
|
||||
|
||||
TraitConfig editedConfig = m_activePlayerData.TraitConfigs[editedIndex];
|
||||
var configSetter = m_values.ModifyValue(m_activePlayerData).ModifyValue(m_activePlayerData.TraitConfigs, editedConfigId);
|
||||
|
||||
// remove traits not found in new config
|
||||
SortedSet<int> entryIndicesToRemove = new(Comparer<int>.Create((a, b) => -a.CompareTo(b)));
|
||||
@@ -1029,10 +1018,7 @@ namespace Game.Entities
|
||||
}
|
||||
|
||||
foreach (int indexToRemove in entryIndicesToRemove)
|
||||
{
|
||||
TraitConfig traitConfig = m_values.ModifyValue(m_activePlayerData).ModifyValue(m_activePlayerData.TraitConfigs, editedIndex);
|
||||
RemoveDynamicUpdateFieldValue(traitConfig.ModifyValue(traitConfig.Entries), indexToRemove);
|
||||
}
|
||||
RemoveDynamicUpdateFieldValue(configSetter.ModifyValue(configSetter.Entries), indexToRemove);
|
||||
|
||||
List<TraitEntryPacket> costEntries = new();
|
||||
|
||||
@@ -1045,14 +1031,13 @@ namespace Game.Entities
|
||||
if (consumeCurrencies)
|
||||
costEntries.Add(newEntry);
|
||||
|
||||
TraitConfig newTraitConfig = m_values.ModifyValue(m_activePlayerData).ModifyValue(m_activePlayerData.TraitConfigs, editedIndex);
|
||||
TraitEntry newUfEntry = new();
|
||||
newUfEntry.TraitNodeID = newEntry.TraitNodeID;
|
||||
newUfEntry.TraitNodeEntryID = newEntry.TraitNodeEntryID;
|
||||
newUfEntry.Rank = newEntry.Rank;
|
||||
newUfEntry.GrantedRanks = newEntry.GrantedRanks;
|
||||
|
||||
AddDynamicUpdateFieldValue(newTraitConfig.ModifyValue(newTraitConfig.Entries), newUfEntry);
|
||||
AddDynamicUpdateFieldValue(configSetter.ModifyValue(configSetter.Entries), newUfEntry);
|
||||
|
||||
if (applyTraits)
|
||||
{
|
||||
@@ -1069,11 +1054,10 @@ namespace Game.Entities
|
||||
costEntries.Add(newEntry);
|
||||
}
|
||||
|
||||
TraitConfig traitConfig = m_values.ModifyValue(m_activePlayerData).ModifyValue(m_activePlayerData.TraitConfigs, editedIndex);
|
||||
TraitEntry traitEntry = traitConfig.ModifyValue(traitConfig.Entries, oldEntryIndex);
|
||||
TraitEntry traitEntry = configSetter.ModifyValue(configSetter.Entries, oldEntryIndex);
|
||||
traitEntry.Rank = newEntry.Rank;
|
||||
traitEntry.GrantedRanks = newEntry.GrantedRanks;
|
||||
SetUpdateFieldValue(traitConfig.Entries, oldEntryIndex, traitEntry);
|
||||
SetUpdateFieldValue(configSetter.Entries, oldEntryIndex, traitEntry);
|
||||
|
||||
if (applyTraits)
|
||||
ApplyTraitEntry(newEntry.TraitNodeEntryID, newEntry.Rank, newEntry.GrantedRanks, true);
|
||||
@@ -1126,19 +1110,17 @@ namespace Game.Entities
|
||||
newUfSubTree.Active = newSubTree.Active ? 1 : 0u;
|
||||
newUfSubTree.Entries = subTreeEntries;
|
||||
|
||||
TraitConfig traitConfig = m_values.ModifyValue(m_activePlayerData).ModifyValue(m_activePlayerData.TraitConfigs, editedIndex);
|
||||
AddDynamicUpdateFieldValue(traitConfig.ModifyValue(traitConfig.SubTrees), newUfSubTree);
|
||||
AddDynamicUpdateFieldValue(configSetter.ModifyValue(configSetter.SubTrees), newUfSubTree);
|
||||
}
|
||||
else
|
||||
{
|
||||
bool wasActive = m_activePlayerData.TraitConfigs[editedIndex].SubTrees[oldSubTreeIndex].Active != 0;
|
||||
bool wasActive = configSetter.SubTrees[oldSubTreeIndex].Active != 0;
|
||||
|
||||
TraitConfig traitConfig = m_values.ModifyValue(m_activePlayerData).ModifyValue(m_activePlayerData.TraitConfigs, editedIndex);
|
||||
TraitSubTreeCache traitSubTreeCache = traitConfig.ModifyValue(traitConfig.SubTrees, oldSubTreeIndex);
|
||||
TraitSubTreeCache traitSubTreeCache = configSetter.ModifyValue(configSetter.SubTrees, oldSubTreeIndex);
|
||||
|
||||
traitSubTreeCache.Active = newSubTree.Active ? 1 : 0u;
|
||||
traitSubTreeCache.Entries = subTreeEntries;
|
||||
SetUpdateFieldValue(traitConfig.ModifyValue(traitConfig.SubTrees, oldSubTreeIndex), traitSubTreeCache);
|
||||
SetUpdateFieldValue(configSetter.ModifyValue(configSetter.SubTrees, oldSubTreeIndex), traitSubTreeCache);
|
||||
|
||||
|
||||
if (applyTraits && wasActive != newSubTree.Active)
|
||||
@@ -1163,16 +1145,13 @@ namespace Game.Entities
|
||||
|
||||
public void RenameTraitConfig(int editedConfigId, string newName)
|
||||
{
|
||||
int editedIndex = m_activePlayerData.TraitConfigs.FindIndexIf(traitConfig =>
|
||||
{
|
||||
return traitConfig.ID == editedConfigId
|
||||
&& (TraitConfigType)(int)traitConfig.Type == TraitConfigType.Combat
|
||||
&& ((TraitCombatConfigFlags)(int)traitConfig.CombatConfigFlags & TraitCombatConfigFlags.ActiveForSpec) == TraitCombatConfigFlags.None;
|
||||
});
|
||||
if (editedIndex < 0)
|
||||
TraitConfig editedConfig = m_activePlayerData.TraitConfigs.Get(editedConfigId).Item1;
|
||||
if (editedConfig == null
|
||||
|| (TraitConfigType)(int)editedConfig.Type != TraitConfigType.Combat
|
||||
|| ((TraitCombatConfigFlags)(int)editedConfig.CombatConfigFlags & TraitCombatConfigFlags.ActiveForSpec) != TraitCombatConfigFlags.None)
|
||||
return;
|
||||
|
||||
TraitConfig traitConfig = m_values.ModifyValue(m_activePlayerData).ModifyValue(m_activePlayerData.TraitConfigs, editedIndex);
|
||||
TraitConfig traitConfig = m_values.ModifyValue(m_activePlayerData).ModifyValue(m_activePlayerData.TraitConfigs, editedConfigId);
|
||||
SetUpdateFieldValue(traitConfig.ModifyValue(traitConfig.Name), newName);
|
||||
|
||||
m_traitConfigStates[editedConfigId] = PlayerSpellState.Changed;
|
||||
@@ -1180,17 +1159,14 @@ namespace Game.Entities
|
||||
|
||||
public void DeleteTraitConfig(int deletedConfigId)
|
||||
{
|
||||
int deletedIndex = m_activePlayerData.TraitConfigs.FindIndexIf(traitConfig =>
|
||||
{
|
||||
return traitConfig.ID == deletedConfigId
|
||||
&& (TraitConfigType)(int)traitConfig.Type == TraitConfigType.Combat
|
||||
&& ((TraitCombatConfigFlags)(int)traitConfig.CombatConfigFlags & TraitCombatConfigFlags.ActiveForSpec) == TraitCombatConfigFlags.None;
|
||||
});
|
||||
if (deletedIndex < 0)
|
||||
TraitConfig deletedConfig = m_activePlayerData.TraitConfigs.Get(deletedConfigId).Item1;
|
||||
if (deletedConfig == null
|
||||
|| (TraitConfigType)(int)deletedConfig.Type != TraitConfigType.Combat
|
||||
|| ((TraitCombatConfigFlags)(int)deletedConfig.CombatConfigFlags & TraitCombatConfigFlags.ActiveForSpec) != TraitCombatConfigFlags.None)
|
||||
return;
|
||||
|
||||
RemoveDynamicUpdateFieldValue(m_values.ModifyValue(m_activePlayerData)
|
||||
.ModifyValue(m_activePlayerData.TraitConfigs), deletedIndex);
|
||||
RemoveMapUpdateFieldValue(m_values.ModifyValue(m_activePlayerData)
|
||||
.ModifyValue(m_activePlayerData.TraitConfigs), deletedConfigId);
|
||||
|
||||
m_traitConfigStates[deletedConfigId] = PlayerSpellState.Removed;
|
||||
}
|
||||
@@ -1238,27 +1214,24 @@ namespace Game.Entities
|
||||
|
||||
public void SetTraitConfigUseStarterBuild(int traitConfigId, bool useStarterBuild)
|
||||
{
|
||||
int configIndex = m_activePlayerData.TraitConfigs.FindIndexIf(traitConfig =>
|
||||
{
|
||||
return traitConfig.ID == traitConfigId
|
||||
&& (TraitConfigType)(int)traitConfig.Type == TraitConfigType.Combat
|
||||
&& ((TraitCombatConfigFlags)(int)traitConfig.CombatConfigFlags & TraitCombatConfigFlags.ActiveForSpec) != TraitCombatConfigFlags.None;
|
||||
});
|
||||
if (configIndex < 0)
|
||||
TraitConfig config = m_activePlayerData.TraitConfigs.Get(traitConfigId).Item1;
|
||||
if (config == null
|
||||
|| (TraitConfigType)(int)config.Type != TraitConfigType.Combat
|
||||
|| ((TraitCombatConfigFlags)(int)config.CombatConfigFlags & TraitCombatConfigFlags.ActiveForSpec) == TraitCombatConfigFlags.None)
|
||||
return;
|
||||
|
||||
bool currentlyUsesStarterBuild = ((TraitCombatConfigFlags)(int)m_activePlayerData.TraitConfigs[configIndex].CombatConfigFlags).HasFlag(TraitCombatConfigFlags.StarterBuild);
|
||||
bool currentlyUsesStarterBuild = ((TraitCombatConfigFlags)(int)config.CombatConfigFlags).HasFlag(TraitCombatConfigFlags.StarterBuild);
|
||||
if (currentlyUsesStarterBuild == useStarterBuild)
|
||||
return;
|
||||
|
||||
if (useStarterBuild)
|
||||
{
|
||||
TraitConfig traitConfig = m_values.ModifyValue(m_activePlayerData).ModifyValue(m_activePlayerData.TraitConfigs, configIndex);
|
||||
TraitConfig traitConfig = m_values.ModifyValue(m_activePlayerData).ModifyValue(m_activePlayerData.TraitConfigs, traitConfigId);
|
||||
SetUpdateFieldFlagValue(traitConfig.ModifyValue(traitConfig.CombatConfigFlags), (int)TraitCombatConfigFlags.StarterBuild);
|
||||
}
|
||||
else
|
||||
{
|
||||
TraitConfig traitConfig = m_values.ModifyValue(m_activePlayerData).ModifyValue(m_activePlayerData.TraitConfigs, configIndex);
|
||||
TraitConfig traitConfig = m_values.ModifyValue(m_activePlayerData).ModifyValue(m_activePlayerData.TraitConfigs, traitConfigId);
|
||||
RemoveUpdateFieldFlagValue(traitConfig.ModifyValue(traitConfig.CombatConfigFlags), (int)TraitCombatConfigFlags.StarterBuild);
|
||||
}
|
||||
|
||||
@@ -1267,20 +1240,17 @@ namespace Game.Entities
|
||||
|
||||
public void SetTraitConfigUseSharedActionBars(int traitConfigId, bool usesSharedActionBars, bool isLastSelectedSavedConfig)
|
||||
{
|
||||
int configIndex = m_activePlayerData.TraitConfigs.FindIndexIf(traitConfig =>
|
||||
{
|
||||
return traitConfig.ID == traitConfigId
|
||||
&& (TraitConfigType)(int)traitConfig.Type == TraitConfigType.Combat
|
||||
&& ((TraitCombatConfigFlags)(int)traitConfig.CombatConfigFlags & TraitCombatConfigFlags.ActiveForSpec) == TraitCombatConfigFlags.None;
|
||||
});
|
||||
if (configIndex < 0)
|
||||
TraitConfig config = m_activePlayerData.TraitConfigs.Get(traitConfigId).Item1;
|
||||
if (config == null
|
||||
|| (TraitConfigType)(int)config.Type != TraitConfigType.Combat
|
||||
|| ((TraitCombatConfigFlags)(int)config.CombatConfigFlags & TraitCombatConfigFlags.ActiveForSpec) != TraitCombatConfigFlags.None)
|
||||
return;
|
||||
|
||||
bool currentlyUsesSharedActionBars = ((TraitCombatConfigFlags)(int)m_activePlayerData.TraitConfigs[configIndex].CombatConfigFlags).HasFlag(TraitCombatConfigFlags.SharedActionBars);
|
||||
bool currentlyUsesSharedActionBars = ((TraitCombatConfigFlags)(int)config.CombatConfigFlags).HasFlag(TraitCombatConfigFlags.SharedActionBars);
|
||||
if (currentlyUsesSharedActionBars == usesSharedActionBars)
|
||||
return;
|
||||
|
||||
TraitConfig traitConfig = m_values.ModifyValue(m_activePlayerData).ModifyValue(m_activePlayerData.TraitConfigs, configIndex);
|
||||
TraitConfig traitConfig = m_values.ModifyValue(m_activePlayerData).ModifyValue(m_activePlayerData.TraitConfigs, traitConfigId);
|
||||
if (usesSharedActionBars)
|
||||
{
|
||||
SetUpdateFieldFlagValue(traitConfig.ModifyValue(traitConfig.CombatConfigFlags), (int)TraitCombatConfigFlags.SharedActionBars);
|
||||
|
||||
@@ -1247,7 +1247,7 @@ namespace Game.Entities
|
||||
RemoveAurasWithInterruptFlags(SpellAuraInterruptFlags2.AbandonVehicle);
|
||||
}
|
||||
|
||||
public void SendPlaySpellVisual(Unit target, uint spellVisualId, ushort missReason, ushort reflectStatus, float travelSpeed, bool speedAsTime = false, float launchDelay = 0f)
|
||||
public void SendPlaySpellVisual(Unit target, uint spellVisualId, byte missReason, byte reflectStatus, float travelSpeed, bool speedAsTime = false, float launchDelay = 0f)
|
||||
{
|
||||
PlaySpellVisual playSpellVisual = new();
|
||||
playSpellVisual.Source = GetGUID();
|
||||
@@ -1262,7 +1262,7 @@ namespace Game.Entities
|
||||
SendMessageToSet(playSpellVisual, true);
|
||||
}
|
||||
|
||||
public void SendPlaySpellVisual(Position targetPosition, uint spellVisualId, ushort missReason, ushort reflectStatus, float travelSpeed, bool speedAsTime = false, float launchDelay = 0f)
|
||||
public void SendPlaySpellVisual(Position targetPosition, uint spellVisualId, byte missReason, byte reflectStatus, float travelSpeed, bool speedAsTime = false, float launchDelay = 0f)
|
||||
{
|
||||
PlaySpellVisual playSpellVisual = new();
|
||||
playSpellVisual.Source = GetGUID();
|
||||
|
||||
@@ -226,7 +226,6 @@ namespace Game.Guilds
|
||||
memberData.RaceID = (byte)member.GetRace();
|
||||
|
||||
memberData.Authenticated = false;
|
||||
memberData.SorEligible = false;
|
||||
|
||||
memberData.Name = member.GetName();
|
||||
memberData.Note = member.GetPublicNote();
|
||||
@@ -3091,7 +3090,7 @@ namespace Game.Guilds
|
||||
newsEvent.MemberGuid = GetPlayerGuid();
|
||||
newsEvent.CompletedDate.SetUtcTimeFromUnixTime(GetTimestamp());
|
||||
newsEvent.Flags = GetFlags();
|
||||
newsEvent.Type = (int)GetNewsType();
|
||||
newsEvent.Type = (sbyte)GetNewsType();
|
||||
|
||||
//for (public byte i = 0; i < 2; i++)
|
||||
// newsEvent.Data[i] =
|
||||
|
||||
@@ -120,6 +120,20 @@ namespace Game
|
||||
features.EuropaTicketSystemStatus = europaTicketConfig;
|
||||
|
||||
SendPacket(features);
|
||||
|
||||
MirrorVarSingle[] vars =
|
||||
{
|
||||
new MirrorVarSingle("raidLockoutExtendEnabled", "1"),
|
||||
new MirrorVarSingle("bypassItemLevelScalingCode", "0"),
|
||||
new MirrorVarSingle("shop2Enabled", "0"),
|
||||
new MirrorVarSingle("bpayStoreEnable", "0"),
|
||||
new MirrorVarSingle("recentAlliesEnabledClient", "0"),
|
||||
new MirrorVarSingle("browserEnabled", "0"),
|
||||
};
|
||||
|
||||
MirrorVars variables = new();
|
||||
variables.Variables = vars;
|
||||
SendPacket(variables);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1145,7 +1145,7 @@ namespace Game
|
||||
// START OF DUMMY VALUES
|
||||
features.ComplaintStatus = (byte)ComplaintStatus.EnabledWithAutoIgnore;
|
||||
features.CfgRealmID = 2;
|
||||
features.CfgRealmRecID = 0;
|
||||
features.CfgRealmRecID = (int)Global.RealmMgr.GetCurrentRealmId().Index;
|
||||
features.CommercePricePollTimeSeconds = 300;
|
||||
features.VoiceEnabled = false;
|
||||
|
||||
@@ -1184,6 +1184,14 @@ namespace Game
|
||||
features.GameRules.Add(rule);
|
||||
}
|
||||
|
||||
features.AddonChatThrottle.MaxTries = 10;
|
||||
features.AddonChatThrottle.TriesRestoredPerSecond = 1;
|
||||
features.AddonChatThrottle.UsedTriesPerMessage = 1;
|
||||
features.GuildChatThrottle.UsedTriesPerMessage = 1;
|
||||
features.GuildChatThrottle.TriesRestoredPerSecond = 20;
|
||||
features.GroupChatThrottle.UsedTriesPerMessage = 1;
|
||||
features.GroupChatThrottle.TriesRestoredPerSecond = 20;
|
||||
|
||||
SendPacket(features);
|
||||
}
|
||||
|
||||
|
||||
@@ -137,10 +137,10 @@ namespace Game
|
||||
if ((classTalentsRequestNewConfig.Config.CombatConfigFlags & TraitCombatConfigFlags.ActiveForSpec) != (int)TraitCombatConfigFlags.None)
|
||||
return;
|
||||
|
||||
long configCount = _player.m_activePlayerData.TraitConfigs._values.Count(traitConfig =>
|
||||
long configCount = _player.m_activePlayerData.TraitConfigs.GetValues().Count(traitConfig =>
|
||||
{
|
||||
return (TraitConfigType)(int)traitConfig.Type == TraitConfigType.Combat
|
||||
&& ((TraitCombatConfigFlags)(int)traitConfig.CombatConfigFlags & TraitCombatConfigFlags.ActiveForSpec) == TraitCombatConfigFlags.None;
|
||||
return (TraitConfigType)(int)traitConfig.Item1.Type == TraitConfigType.Combat
|
||||
&& ((TraitCombatConfigFlags)(int)traitConfig.Item1.CombatConfigFlags & TraitCombatConfigFlags.ActiveForSpec) == TraitCombatConfigFlags.None;
|
||||
});
|
||||
if (configCount >= TraitMgr.MAX_COMBAT_TRAIT_CONFIGS)
|
||||
return;
|
||||
@@ -148,12 +148,12 @@ namespace Game
|
||||
int findFreeLocalIdentifier()
|
||||
{
|
||||
int index = 1;
|
||||
while (_player.m_activePlayerData.TraitConfigs.FindIndexIf(traitConfig =>
|
||||
while (_player.m_activePlayerData.TraitConfigs.FindIf(traitConfig =>
|
||||
{
|
||||
return (TraitConfigType)(int)traitConfig.Type == TraitConfigType.Combat
|
||||
&& traitConfig.ChrSpecializationID == (int)_player.GetPrimarySpecialization()
|
||||
&& traitConfig.LocalIdentifier == index;
|
||||
}) >= 0)
|
||||
}).Item1 != 0)
|
||||
++index;
|
||||
|
||||
return index;
|
||||
@@ -219,12 +219,12 @@ namespace Game
|
||||
TraitConfigPacket newConfigState = new(traitConfig);
|
||||
|
||||
int freeLocalIdentifier = 1;
|
||||
while (_player.m_activePlayerData.TraitConfigs.FindIndexIf(traitConfig =>
|
||||
while (_player.m_activePlayerData.TraitConfigs.FindIf(traitConfig =>
|
||||
{
|
||||
return (TraitConfigType)(int)traitConfig.Type == TraitConfigType.Combat
|
||||
&& traitConfig.ChrSpecializationID == (int)_player.GetPrimarySpecialization()
|
||||
&& traitConfig.LocalIdentifier == freeLocalIdentifier;
|
||||
}) >= 0)
|
||||
}).Item1 != 0)
|
||||
++freeLocalIdentifier;
|
||||
|
||||
TraitMgr.InitializeStarterBuildTraitConfig(newConfigState, _player);
|
||||
|
||||
@@ -299,7 +299,7 @@ namespace Game.Networking.Packets
|
||||
_worldPacket.WritePackedGuid(InviteGuid);
|
||||
_worldPacket.WriteUInt64(EventID);
|
||||
Date.Write(_worldPacket);
|
||||
_worldPacket.WriteUInt32((uint)Flags);
|
||||
_worldPacket.WriteUInt16((ushort)Flags);
|
||||
_worldPacket.WriteUInt8((byte)Status);
|
||||
ResponseTime.Write(_worldPacket);
|
||||
|
||||
@@ -324,7 +324,7 @@ namespace Game.Networking.Packets
|
||||
{
|
||||
_worldPacket.WritePackedGuid(InviteGuid);
|
||||
_worldPacket.WriteUInt64(EventID);
|
||||
_worldPacket.WriteUInt32(Flags);
|
||||
_worldPacket.WriteUInt16(Flags);
|
||||
|
||||
_worldPacket.WriteBit(ClearPending);
|
||||
_worldPacket.FlushBits();
|
||||
@@ -332,7 +332,7 @@ namespace Game.Networking.Packets
|
||||
|
||||
public ObjectGuid InviteGuid;
|
||||
public ulong EventID;
|
||||
public uint Flags;
|
||||
public ushort Flags;
|
||||
public bool ClearPending;
|
||||
}
|
||||
|
||||
@@ -364,7 +364,7 @@ namespace Game.Networking.Packets
|
||||
{
|
||||
_worldPacket.WriteUInt64(EventID);
|
||||
Date.Write(_worldPacket);
|
||||
_worldPacket.WriteUInt32((uint)Flags);
|
||||
_worldPacket.WriteUInt16((ushort)Flags);
|
||||
_worldPacket.WriteUInt8((byte)Status);
|
||||
}
|
||||
|
||||
@@ -653,12 +653,12 @@ namespace Game.Networking.Packets
|
||||
{
|
||||
_worldPacket.WriteUInt64(EventID);
|
||||
_worldPacket.WritePackedTime(Date);
|
||||
_worldPacket.WriteUInt32(Flags);
|
||||
_worldPacket.WriteUInt16(Flags);
|
||||
_worldPacket.WriteUInt8(Status);
|
||||
}
|
||||
|
||||
public ulong EventID;
|
||||
public uint Flags;
|
||||
public ushort Flags;
|
||||
public long Date;
|
||||
public byte Status;
|
||||
}
|
||||
|
||||
@@ -124,7 +124,7 @@ namespace Game.Networking.Packets
|
||||
if (fields.Read<uint>(18) != 0)
|
||||
Flags |= CharacterFlags.LockedByBilling;
|
||||
|
||||
if (WorldConfig.GetBoolValue(WorldCfg.DeclinedNamesUsed) && !string.IsNullOrEmpty(fields.Read<string>(28)))
|
||||
if (WorldConfig.GetBoolValue(WorldCfg.DeclinedNamesUsed) && !string.IsNullOrEmpty(fields.Read<string>(29)))
|
||||
Flags |= CharacterFlags.Declined;
|
||||
|
||||
if (atLoginFlags.HasAnyFlag(AtLoginFlags.Customize))
|
||||
@@ -168,19 +168,20 @@ namespace Game.Networking.Packets
|
||||
|
||||
StringArray equipment = new(fields.Read<string>(17), ' ');
|
||||
ListPosition = fields.Read<byte>(19);
|
||||
LastActiveTime = fields.Read<long>(20);
|
||||
CreateTime = fields.Read<long>(20);
|
||||
LastActiveTime = fields.Read<long>(21);
|
||||
|
||||
var spec = Global.DB2Mgr.GetChrSpecializationByIndex(ClassId, fields.Read<byte>(21));
|
||||
var spec = Global.DB2Mgr.GetChrSpecializationByIndex(ClassId, fields.Read<byte>(22));
|
||||
if (spec != null)
|
||||
SpecID = (short)spec.Id;
|
||||
|
||||
LastLoginVersion = fields.Read<int>(22);
|
||||
LastLoginVersion = fields.Read<int>(23);
|
||||
|
||||
PersonalTabard.EmblemStyle = fields.Read<int>(23);
|
||||
PersonalTabard.EmblemColor = fields.Read<int>(24);
|
||||
PersonalTabard.BorderStyle = fields.Read<int>(25);
|
||||
PersonalTabard.BorderColor = fields.Read<int>(26);
|
||||
PersonalTabard.BackgroundColor = fields.Read<int>(27);
|
||||
PersonalTabard.EmblemStyle = fields.Read<int>(24);
|
||||
PersonalTabard.EmblemColor = fields.Read<int>(25);
|
||||
PersonalTabard.BorderStyle = fields.Read<int>(26);
|
||||
PersonalTabard.BorderColor = fields.Read<int>(27);
|
||||
PersonalTabard.BackgroundColor = fields.Read<int>(28);
|
||||
|
||||
int equipmentFieldsPerSlot = 5;
|
||||
|
||||
@@ -226,6 +227,7 @@ namespace Game.Networking.Packets
|
||||
visualItem.Write(data);
|
||||
|
||||
data.WriteInt32(SaveVersion);
|
||||
data.WriteInt64(CreateTime);
|
||||
data.WriteInt64(LastActiveTime);
|
||||
data.WriteInt32(LastLoginVersion);
|
||||
PersonalTabard.Write(data);
|
||||
@@ -272,6 +274,7 @@ namespace Game.Networking.Packets
|
||||
public CharacterFlags4 Flags4; // Character flag4 @see enum CharacterFlags4
|
||||
public bool FirstLogin;
|
||||
public byte CantLoginReason;
|
||||
public long CreateTime;
|
||||
public long LastActiveTime;
|
||||
public short SpecID;
|
||||
public int SaveVersion;
|
||||
@@ -520,7 +523,7 @@ namespace Game.Networking.Packets
|
||||
|
||||
public override void Write()
|
||||
{
|
||||
_worldPacket.WriteUInt8((byte)Code);
|
||||
_worldPacket.WriteUInt32((uint)Code);
|
||||
_worldPacket.WritePackedGuid(Guid);
|
||||
}
|
||||
|
||||
@@ -546,7 +549,7 @@ namespace Game.Networking.Packets
|
||||
|
||||
public override void Write()
|
||||
{
|
||||
_worldPacket.WriteUInt8((byte)Code);
|
||||
_worldPacket.WriteUInt32((uint)Code);
|
||||
}
|
||||
|
||||
public ResponseCodes Code;
|
||||
@@ -572,7 +575,7 @@ namespace Game.Networking.Packets
|
||||
|
||||
public override void Write()
|
||||
{
|
||||
_worldPacket.WriteUInt8((byte)Result);
|
||||
_worldPacket.WriteUInt32((uint)Result);
|
||||
_worldPacket.WriteBit(Guid.HasValue);
|
||||
_worldPacket.WriteBits(Name.GetByteCount(), 6);
|
||||
_worldPacket.FlushBits();
|
||||
@@ -658,7 +661,7 @@ namespace Game.Networking.Packets
|
||||
|
||||
public override void Write()
|
||||
{
|
||||
_worldPacket.WriteUInt8((byte)Result);
|
||||
_worldPacket.WriteUInt32((uint)Result);
|
||||
_worldPacket.WritePackedGuid(Guid);
|
||||
_worldPacket.WriteBit(Display != null);
|
||||
_worldPacket.FlushBits();
|
||||
@@ -1173,11 +1176,11 @@ namespace Game.Networking.Packets
|
||||
|
||||
public override void Write()
|
||||
{
|
||||
_worldPacket.WriteUInt8(Result);
|
||||
_worldPacket.WriteUInt32(Result);
|
||||
_worldPacket.WritePackedGuid(CharGUID);
|
||||
}
|
||||
|
||||
public byte Result;
|
||||
public uint Result;
|
||||
public ObjectGuid CharGUID;
|
||||
}
|
||||
|
||||
|
||||
@@ -62,6 +62,7 @@ namespace Game.Networking.Packets
|
||||
_worldPacket.WriteInt32(Absorbed);
|
||||
_worldPacket.WriteInt32(Resisted);
|
||||
_worldPacket.WriteInt32(ShieldBlock);
|
||||
_worldPacket.WriteInt32(Flags);
|
||||
_worldPacket.WriteInt32(WorldTextViewers.Count);
|
||||
_worldPacket.WriteInt32(Supporters.Count);
|
||||
|
||||
@@ -69,7 +70,6 @@ namespace Game.Networking.Packets
|
||||
supportInfo.Write(_worldPacket);
|
||||
|
||||
_worldPacket.WriteBit(Periodic);
|
||||
_worldPacket.WriteBits(Flags, 7);
|
||||
_worldPacket.WriteBit(false); // Debug info
|
||||
WriteLogDataBit();
|
||||
_worldPacket.WriteBit(ContentTuning != null);
|
||||
|
||||
@@ -1619,12 +1619,12 @@ namespace Game.Networking.Packets
|
||||
data.WriteUInt8(Gender);
|
||||
data.WriteUInt64(GuildClubMemberID);
|
||||
data.WriteUInt8(RaceID);
|
||||
data.WriteInt32(TimerunningSeasonID);
|
||||
|
||||
data.WriteBits(Name.GetByteCount(), 6);
|
||||
data.WriteBits(Note.GetByteCount(), 8);
|
||||
data.WriteBits(OfficerNote.GetByteCount(), 8);
|
||||
data.WriteBit(Authenticated);
|
||||
data.WriteBit(SorEligible);
|
||||
data.FlushBits();
|
||||
|
||||
DungeonScore.Write(data);
|
||||
@@ -1653,8 +1653,8 @@ namespace Game.Networking.Packets
|
||||
public byte Gender;
|
||||
public ulong GuildClubMemberID;
|
||||
public byte RaceID;
|
||||
public int TimerunningSeasonID;
|
||||
public bool Authenticated;
|
||||
public bool SorEligible;
|
||||
public GuildRosterProfessionData[] Profession = new GuildRosterProfessionData[2];
|
||||
public DungeonScoreSummary DungeonScore = new();
|
||||
}
|
||||
@@ -1758,7 +1758,7 @@ namespace Game.Networking.Packets
|
||||
{
|
||||
data.WriteInt32(Id);
|
||||
CompletedDate.Write(data);
|
||||
data.WriteInt32(Type);
|
||||
data.WriteInt8(Type);
|
||||
data.WriteInt32(Flags);
|
||||
|
||||
for (byte i = 0; i < 2; i++)
|
||||
@@ -1779,7 +1779,7 @@ namespace Game.Networking.Packets
|
||||
|
||||
public int Id;
|
||||
public WowTime CompletedDate;
|
||||
public int Type;
|
||||
public sbyte Type;
|
||||
public int Flags;
|
||||
public int[] Data = new int[2];
|
||||
public ObjectGuid MemberGuid;
|
||||
|
||||
@@ -133,14 +133,14 @@ namespace Game.Networking.Packets
|
||||
public override void Write()
|
||||
{
|
||||
_worldPacket.WritePackedGuid(ItemGUID);
|
||||
_worldPacket.WriteUInt8(Result);
|
||||
_worldPacket.WriteUInt32(Result);
|
||||
_worldPacket.WriteBit(Contents != null);
|
||||
_worldPacket.FlushBits();
|
||||
if (Contents != null)
|
||||
Contents.Write(_worldPacket);
|
||||
}
|
||||
|
||||
public byte Result;
|
||||
public uint Result;
|
||||
public ObjectGuid ItemGUID;
|
||||
public ItemPurchaseContents Contents;
|
||||
}
|
||||
|
||||
@@ -167,7 +167,7 @@ namespace Game.Networking.Packets
|
||||
Ticket.Write(_worldPacket);
|
||||
|
||||
_worldPacket.WriteUInt8(SubType);
|
||||
_worldPacket.WriteUInt8(Reason);
|
||||
_worldPacket.WriteUInt32(Reason);
|
||||
_worldPacket.WriteInt32(Slots.Count);
|
||||
_worldPacket.WriteUInt8(RequestedRoles);
|
||||
_worldPacket.WriteInt32(SuspendedPlayers.Count);
|
||||
@@ -190,7 +190,7 @@ namespace Game.Networking.Packets
|
||||
|
||||
public RideTicket Ticket = new();
|
||||
public byte SubType;
|
||||
public byte Reason;
|
||||
public uint Reason;
|
||||
public List<uint> Slots = new();
|
||||
public byte RequestedRoles;
|
||||
public List<ObjectGuid> SuspendedPlayers = new();
|
||||
|
||||
@@ -212,12 +212,10 @@ namespace Game.Networking.Packets
|
||||
public override void Read() { }
|
||||
}
|
||||
|
||||
public class MailQueryNextTimeResult : ServerPacket
|
||||
public class MailQueryNextTimeResult() : ServerPacket(ServerOpcodes.MailQueryNextTimeResult)
|
||||
{
|
||||
public MailQueryNextTimeResult() : base(ServerOpcodes.MailQueryNextTimeResult)
|
||||
{
|
||||
Next = new List<MailNextTimeEntry>();
|
||||
}
|
||||
public float NextMailTime;
|
||||
public List<MailNextTimeEntry> Next = new();
|
||||
|
||||
public override void Write()
|
||||
{
|
||||
@@ -229,14 +227,11 @@ namespace Game.Networking.Packets
|
||||
_worldPacket.WritePackedGuid(entry.SenderGuid);
|
||||
_worldPacket.WriteFloat(entry.TimeLeft);
|
||||
_worldPacket.WriteInt32(entry.AltSenderID);
|
||||
_worldPacket.WriteInt8(entry.AltSenderType);
|
||||
_worldPacket.WriteInt32(entry.AltSenderType);
|
||||
_worldPacket.WriteInt32(entry.StationeryID);
|
||||
}
|
||||
}
|
||||
|
||||
public float NextMailTime;
|
||||
public List<MailNextTimeEntry> Next;
|
||||
|
||||
public class MailNextTimeEntry
|
||||
{
|
||||
public MailNextTimeEntry(Mail mail)
|
||||
@@ -266,7 +261,7 @@ namespace Game.Networking.Packets
|
||||
public ObjectGuid SenderGuid;
|
||||
public float TimeLeft;
|
||||
public int AltSenderID;
|
||||
public sbyte AltSenderType;
|
||||
public int AltSenderType;
|
||||
public int StationeryID;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -189,10 +189,8 @@ namespace Game.Networking.Packets
|
||||
public ObjectGuid Selection; // Target
|
||||
}
|
||||
|
||||
public class SetupCurrency : ServerPacket
|
||||
public class SetupCurrency() : ServerPacket(ServerOpcodes.SetupCurrency, ConnectionType.Instance)
|
||||
{
|
||||
public SetupCurrency() : base(ServerOpcodes.SetupCurrency, ConnectionType.Instance) { }
|
||||
|
||||
public override void Write()
|
||||
{
|
||||
_worldPacket.WriteInt32(Data.Count);
|
||||
@@ -201,6 +199,7 @@ namespace Game.Networking.Packets
|
||||
{
|
||||
_worldPacket.WriteUInt32(data.Type);
|
||||
_worldPacket.WriteUInt32(data.Quantity);
|
||||
_worldPacket.WriteUInt8(data.Flags);
|
||||
|
||||
_worldPacket.WriteBit(data.WeeklyQuantity.HasValue);
|
||||
_worldPacket.WriteBit(data.MaxWeeklyQuantity.HasValue);
|
||||
@@ -209,7 +208,6 @@ namespace Game.Networking.Packets
|
||||
_worldPacket.WriteBit(data.TotalEarned.HasValue);
|
||||
_worldPacket.WriteBit(data.NextRechargeTime.HasValue);
|
||||
_worldPacket.WriteBit(data.RechargeCycleStartTime.HasValue);
|
||||
_worldPacket.WriteBits(data.Flags, 5);
|
||||
_worldPacket.FlushBits();
|
||||
|
||||
if (data.WeeklyQuantity.HasValue)
|
||||
|
||||
@@ -1520,27 +1520,13 @@ namespace Game.Networking.Packets
|
||||
public void Write(WorldPacket data)
|
||||
{
|
||||
data.WriteUInt32(Flags);
|
||||
data.WriteUInt8((byte)Face);
|
||||
data.WriteInt32(Elapsed);
|
||||
data.WriteUInt32(MoveTime);
|
||||
data.WriteUInt32(FadeObjectTime);
|
||||
data.WriteUInt8(Mode);
|
||||
data.WritePackedGuid(TransportGUID);
|
||||
data.WriteInt8(VehicleSeat);
|
||||
data.WriteBits((byte)Face, 2);
|
||||
data.WriteBits(Points.Count, 16);
|
||||
data.WriteBit(VehicleExitVoluntary);
|
||||
data.WriteBit(TaxiSmoothing);
|
||||
data.WriteBits(PackedDeltas.Count, 16);
|
||||
data.WriteBit(SplineFilter != null);
|
||||
data.WriteBit(SpellEffectExtraData.HasValue);
|
||||
data.WriteBit(JumpExtraData.HasValue);
|
||||
data.WriteBit(TurnData != null);
|
||||
data.WriteBit(AnimTierTransition.HasValue);
|
||||
data.WriteBit(Unknown901 != null);
|
||||
data.FlushBits();
|
||||
|
||||
if (SplineFilter != null)
|
||||
SplineFilter.Write(data);
|
||||
|
||||
switch (Face)
|
||||
{
|
||||
@@ -1556,6 +1542,21 @@ namespace Game.Networking.Packets
|
||||
break;
|
||||
}
|
||||
|
||||
data.WriteBits(Points.Count, 16);
|
||||
data.WriteBit(VehicleExitVoluntary);
|
||||
data.WriteBit(TaxiSmoothing);
|
||||
data.WriteBits(PackedDeltas.Count, 16);
|
||||
data.WriteBit(SplineFilter != null);
|
||||
data.WriteBit(SpellEffectExtraData.HasValue);
|
||||
data.WriteBit(JumpExtraData.HasValue);
|
||||
data.WriteBit(TurnData != null);
|
||||
data.WriteBit(AnimTierTransition.HasValue);
|
||||
data.WriteBit(Unknown901 != null);
|
||||
data.FlushBits();
|
||||
|
||||
if (SplineFilter != null)
|
||||
SplineFilter.Write(data);
|
||||
|
||||
foreach (Vector3 pos in Points)
|
||||
data.WriteVector3(pos);
|
||||
|
||||
|
||||
@@ -164,7 +164,7 @@ namespace Game.Networking.Packets
|
||||
public override void Write()
|
||||
{
|
||||
_worldPacket.WritePackedGuid(TrainerGUID);
|
||||
_worldPacket.WriteInt32(TrainerType);
|
||||
_worldPacket.WriteInt8(TrainerType);
|
||||
_worldPacket.WriteInt32(TrainerID);
|
||||
|
||||
_worldPacket.WriteInt32(Spells.Count);
|
||||
@@ -188,7 +188,7 @@ namespace Game.Networking.Packets
|
||||
}
|
||||
|
||||
public ObjectGuid TrainerGUID;
|
||||
public int TrainerType;
|
||||
public sbyte TrainerType;
|
||||
public int TrainerID = 1;
|
||||
public List<TrainerListSpell> Spells = new();
|
||||
public string Greeting;
|
||||
@@ -339,7 +339,7 @@ namespace Game.Networking.Packets
|
||||
{
|
||||
public int GossipOptionID;
|
||||
public GossipOptionNpc OptionNPC;
|
||||
public byte OptionFlags;
|
||||
public int OptionFlags;
|
||||
public ulong OptionCost;
|
||||
public uint OptionLanguage;
|
||||
public GossipOptionFlags Flags;
|
||||
@@ -355,8 +355,8 @@ namespace Game.Networking.Packets
|
||||
public void Write(WorldPacket data)
|
||||
{
|
||||
data.WriteInt32(GossipOptionID);
|
||||
data.WriteInt32(OptionFlags);
|
||||
data.WriteUInt8((byte)OptionNPC);
|
||||
data.WriteInt8((sbyte)OptionFlags);
|
||||
data.WriteUInt64(OptionCost);
|
||||
data.WriteUInt32(OptionLanguage);
|
||||
data.WriteInt32((int)Flags);
|
||||
|
||||
@@ -1195,7 +1195,7 @@ namespace Game.Networking.Packets
|
||||
for (byte i = 0; i < 2; i++)
|
||||
data.WriteUInt8(PartyType[i]);
|
||||
|
||||
data.WriteInt16((short)Status);
|
||||
data.WriteUInt32((uint)Status);
|
||||
data.WriteUInt8(PowerType);
|
||||
data.WriteInt16((short)PowerDisplayID);
|
||||
data.WriteInt32(CurrentHealth);
|
||||
@@ -1387,6 +1387,7 @@ namespace Game.Networking.Packets
|
||||
public long Unknown_1120_4;
|
||||
public ObjectGuid KeystoneOwnerGUID;
|
||||
public ObjectGuid LeaverGUID;
|
||||
public long InstanceAbandonVoteCooldown;
|
||||
public bool IsActive;
|
||||
public bool HasRestrictions;
|
||||
public bool CanVoteAbandon;
|
||||
@@ -1399,6 +1400,7 @@ namespace Game.Networking.Packets
|
||||
data.WriteInt64(Unknown_1120_4);
|
||||
data.WritePackedGuid(KeystoneOwnerGUID);
|
||||
data.WritePackedGuid(LeaverGUID);
|
||||
data.WriteInt64(InstanceAbandonVoteCooldown);
|
||||
data.WriteBit(IsActive);
|
||||
data.WriteBit(HasRestrictions);
|
||||
data.WriteBit(CanVoteAbandon);
|
||||
|
||||
@@ -183,7 +183,7 @@ namespace Game.Networking.Packets
|
||||
|
||||
public override void Write()
|
||||
{
|
||||
_worldPacket.WriteUInt8((byte)Result);
|
||||
_worldPacket.WriteUInt32((uint)Result);
|
||||
_worldPacket.WritePackedGuid(RenameData.PetGUID);
|
||||
_worldPacket.WriteInt32(RenameData.PetNumber);
|
||||
|
||||
@@ -317,8 +317,8 @@ namespace Game.Networking.Packets
|
||||
|
||||
public override void Write()
|
||||
{
|
||||
_worldPacket.WriteInt32((int)Response);
|
||||
_worldPacket.WriteUInt32(SpellID);
|
||||
_worldPacket.WriteUInt8((byte)Response);
|
||||
}
|
||||
|
||||
public uint SpellID;
|
||||
@@ -345,10 +345,10 @@ namespace Game.Networking.Packets
|
||||
|
||||
public override void Write()
|
||||
{
|
||||
_worldPacket.WriteUInt8(Result);
|
||||
_worldPacket.WriteUInt32(Result);
|
||||
}
|
||||
|
||||
public byte Result;
|
||||
public uint Result;
|
||||
}
|
||||
|
||||
class PetMode : ServerPacket
|
||||
|
||||
@@ -294,7 +294,7 @@ namespace Game.Networking.Packets
|
||||
data.WriteInt32(AllowedMinLevel);
|
||||
data.WriteInt32(AllowedMaxLevel);
|
||||
data.WriteInt32(NumChoices);
|
||||
data.WriteInt32(StaticType);
|
||||
data.WriteInt8(StaticType);
|
||||
data.WriteUInt32(Muid);
|
||||
|
||||
data.WriteBits(Title.GetByteCount(), 8);
|
||||
@@ -327,7 +327,7 @@ namespace Game.Networking.Packets
|
||||
public int AllowedMinLevel;
|
||||
public int AllowedMaxLevel;
|
||||
public int NumChoices;
|
||||
public int StaticType;
|
||||
public sbyte StaticType;
|
||||
public uint Muid = 0;
|
||||
public StringArray Choicetext = new(10);
|
||||
}
|
||||
|
||||
@@ -270,7 +270,7 @@ namespace Game.Networking.Packets
|
||||
_worldPacket.WriteInt32(ObjectID);
|
||||
_worldPacket.WriteUInt16(Count);
|
||||
_worldPacket.WriteUInt16(Required);
|
||||
_worldPacket.WriteUInt8(ObjectiveType);
|
||||
_worldPacket.WriteUInt32(ObjectiveType);
|
||||
}
|
||||
|
||||
public ObjectGuid VictimGUID;
|
||||
@@ -278,7 +278,7 @@ namespace Game.Networking.Packets
|
||||
public uint QuestID;
|
||||
public ushort Count;
|
||||
public ushort Required;
|
||||
public byte ObjectiveType;
|
||||
public uint ObjectiveType;
|
||||
}
|
||||
|
||||
class QuestUpdateAddCreditSimple : ServerPacket
|
||||
@@ -289,7 +289,7 @@ namespace Game.Networking.Packets
|
||||
{
|
||||
_worldPacket.WriteUInt32(QuestID);
|
||||
_worldPacket.WriteInt32(ObjectID);
|
||||
_worldPacket.WriteUInt8((byte)ObjectiveType);
|
||||
_worldPacket.WriteUInt32((uint)ObjectiveType);
|
||||
}
|
||||
|
||||
public uint QuestID;
|
||||
@@ -748,7 +748,7 @@ namespace Game.Networking.Packets
|
||||
public override void Write()
|
||||
{
|
||||
_worldPacket.WritePackedGuid(SenderGUID);
|
||||
_worldPacket.WriteUInt8((byte)Result);
|
||||
_worldPacket.WriteUInt32((uint)Result);
|
||||
|
||||
_worldPacket.WriteBits(QuestTitle.GetByteCount(), 9);
|
||||
_worldPacket.FlushBits();
|
||||
@@ -769,7 +769,7 @@ namespace Game.Networking.Packets
|
||||
{
|
||||
SenderGUID = _worldPacket.ReadPackedGuid();
|
||||
QuestID = _worldPacket.ReadUInt32();
|
||||
Result = (QuestPushReason)_worldPacket.ReadUInt8();
|
||||
Result = (QuestPushReason)_worldPacket.ReadUInt32();
|
||||
}
|
||||
|
||||
public ObjectGuid SenderGUID;
|
||||
|
||||
@@ -736,9 +736,9 @@ namespace Game.Networking.Packets
|
||||
_worldPacket.WriteVector3(TargetPosition);
|
||||
_worldPacket.WriteUInt32(SpellVisualID);
|
||||
_worldPacket.WriteFloat(TravelSpeed);
|
||||
_worldPacket.WriteUInt16(HitReason);
|
||||
_worldPacket.WriteUInt16(MissReason);
|
||||
_worldPacket.WriteUInt16(ReflectStatus);
|
||||
_worldPacket.WriteUInt8(HitReason);
|
||||
_worldPacket.WriteUInt8(MissReason);
|
||||
_worldPacket.WriteUInt8(ReflectStatus);
|
||||
_worldPacket.WriteFloat(LaunchDelay);
|
||||
_worldPacket.WriteFloat(MinDuration);
|
||||
_worldPacket.WriteBit(SpeedAsTime);
|
||||
@@ -751,9 +751,9 @@ namespace Game.Networking.Packets
|
||||
public Vector3 TargetPosition; // Overrides missile destination for SpellVisual::SpellVisualMissileSetID
|
||||
public uint SpellVisualID;
|
||||
public float TravelSpeed;
|
||||
public ushort HitReason;
|
||||
public ushort MissReason;
|
||||
public ushort ReflectStatus;
|
||||
public byte HitReason;
|
||||
public byte MissReason;
|
||||
public byte ReflectStatus;
|
||||
public float LaunchDelay;
|
||||
public float MinDuration;
|
||||
public bool SpeedAsTime;
|
||||
@@ -1686,6 +1686,7 @@ namespace Game.Networking.Packets
|
||||
data.WriteInt32(ContentTuningID);
|
||||
data.WriteVector3(DstLocation);
|
||||
data.WriteBit(CastUnit.HasValue);
|
||||
data.WriteBit(CastItem.HasValue);
|
||||
data.WriteBit(Duration.HasValue);
|
||||
data.WriteBit(Remaining.HasValue);
|
||||
data.WriteBit(TimeMod.HasValue);
|
||||
@@ -1699,6 +1700,9 @@ namespace Game.Networking.Packets
|
||||
if (CastUnit.HasValue)
|
||||
data.WritePackedGuid(CastUnit.Value);
|
||||
|
||||
if (CastItem.HasValue)
|
||||
data.WritePackedGuid(CastItem.Value);
|
||||
|
||||
if (Duration.HasValue)
|
||||
data.WriteInt32(Duration.Value);
|
||||
|
||||
@@ -1725,6 +1729,7 @@ namespace Game.Networking.Packets
|
||||
public int ContentTuningID;
|
||||
ContentTuningParams ContentTuning;
|
||||
public ObjectGuid? CastUnit;
|
||||
public ObjectGuid? CastItem;
|
||||
public int? Duration;
|
||||
public int? Remaining;
|
||||
float? TimeMod;
|
||||
@@ -1776,8 +1781,10 @@ namespace Game.Networking.Packets
|
||||
{
|
||||
public void Read(WorldPacket data)
|
||||
{
|
||||
data.ResetBitPos();
|
||||
Flags = (SpellCastTargetFlags)data.ReadBits<uint>(28);
|
||||
Flags = (SpellCastTargetFlags)data.ReadUInt32();
|
||||
Unit = data.ReadPackedGuid();
|
||||
Item = data.ReadPackedGuid();
|
||||
|
||||
if (data.HasBit())
|
||||
SrcLocation = new();
|
||||
|
||||
@@ -1789,9 +1796,6 @@ namespace Game.Networking.Packets
|
||||
|
||||
uint nameLength = data.ReadBits<uint>(7);
|
||||
|
||||
Unit = data.ReadPackedGuid();
|
||||
Item = data.ReadPackedGuid();
|
||||
|
||||
if (SrcLocation != null)
|
||||
SrcLocation.Read(data);
|
||||
|
||||
@@ -1809,7 +1813,10 @@ namespace Game.Networking.Packets
|
||||
|
||||
public void Write(WorldPacket data)
|
||||
{
|
||||
data.WriteBits((uint)Flags, 28);
|
||||
data.WriteUInt32((uint)Flags);
|
||||
data.WritePackedGuid(Unit);
|
||||
data.WritePackedGuid(Item);
|
||||
|
||||
data.WriteBit(SrcLocation != null);
|
||||
data.WriteBit(DstLocation != null);
|
||||
data.WriteBit(Orientation.HasValue);
|
||||
@@ -1817,9 +1824,6 @@ namespace Game.Networking.Packets
|
||||
data.WriteBits(Name.GetByteCount(), 7);
|
||||
data.FlushBits();
|
||||
|
||||
data.WritePackedGuid(Unit);
|
||||
data.WritePackedGuid(Item);
|
||||
|
||||
if (SrcLocation != null)
|
||||
SrcLocation.Write(data);
|
||||
|
||||
@@ -1914,6 +1918,7 @@ namespace Game.Networking.Packets
|
||||
public void Read(WorldPacket data)
|
||||
{
|
||||
CastID = data.ReadPackedGuid();
|
||||
SendCastFlags = data.ReadUInt32();
|
||||
Misc[0] = data.ReadUInt32();
|
||||
Misc[1] = data.ReadUInt32();
|
||||
SpellID = data.ReadUInt32();
|
||||
@@ -1931,19 +1936,19 @@ namespace Game.Networking.Packets
|
||||
for (var i = 0; i < optionalCurrenciesCount; ++i)
|
||||
OptionalCurrencies[i].Read(data);
|
||||
|
||||
SendCastFlags = data.ReadBits<uint>(6);
|
||||
Target.Read(data);
|
||||
|
||||
data.ResetBitPos();
|
||||
bool hasMoveUpdate = data.HasBit();
|
||||
var weightCount = data.ReadBits<uint>(2);
|
||||
bool hasCraftingOrderID = data.HasBit();
|
||||
|
||||
Target.Read(data);
|
||||
for (var i = 0; i < optionalReagentsCount; ++i)
|
||||
OptionalReagents[i].Read(data);
|
||||
|
||||
if (hasCraftingOrderID)
|
||||
CraftingOrderID = data.ReadUInt64();
|
||||
|
||||
for (var i = 0; i < optionalReagentsCount; ++i)
|
||||
OptionalReagents[i].Read(data);
|
||||
|
||||
for (var i = 0; i < removedModificationsCount; ++i)
|
||||
RemovedModifications[i].Read(data);
|
||||
|
||||
@@ -2046,7 +2051,7 @@ namespace Game.Networking.Packets
|
||||
public void Write(WorldPacket data)
|
||||
{
|
||||
data.WriteUInt32(Points);
|
||||
data.WriteUInt8((byte)Type);
|
||||
data.WriteUInt32((uint)Type);
|
||||
data.WritePackedGuid(BeaconGUID);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,6 +46,10 @@ namespace Game.Networking.Packets
|
||||
_worldPacket.WriteInt32(AddonChatThrottle.MaxTries);
|
||||
_worldPacket.WriteInt32(AddonChatThrottle.TriesRestoredPerSecond);
|
||||
_worldPacket.WriteInt32(AddonChatThrottle.UsedTriesPerMessage);
|
||||
_worldPacket.WriteInt32(GuildChatThrottle.UsedTriesPerMessage);
|
||||
_worldPacket.WriteInt32(GuildChatThrottle.TriesRestoredPerSecond);
|
||||
_worldPacket.WriteInt32(GroupChatThrottle.UsedTriesPerMessage);
|
||||
_worldPacket.WriteInt32(GroupChatThrottle.TriesRestoredPerSecond);
|
||||
|
||||
_worldPacket.WriteFloat(AddonPerformanceMsgWarning);
|
||||
_worldPacket.WriteFloat(AddonPerformanceMsgError);
|
||||
@@ -202,7 +206,9 @@ namespace Game.Networking.Packets
|
||||
public int ActiveTimerunningSeasonID;
|
||||
public int RemainingTimerunningSeasonSeconds;
|
||||
public string Unknown1027; // related to movement lua functions used by keybinds
|
||||
public AddonChatThrottleParams AddonChatThrottle;
|
||||
public ChatThrottleParams AddonChatThrottle;
|
||||
public ChatThrottleParams GuildChatThrottle;
|
||||
public ChatThrottleParams GroupChatThrottle;
|
||||
public uint RealmPvpTypeOverride; ///< Use Cfg_Configs value = 0, ForceEnabled = 1, ForceDisabled = 2
|
||||
public float AddonPerformanceMsgWarning;
|
||||
public float AddonPerformanceMsgError;
|
||||
@@ -288,7 +294,7 @@ namespace Game.Networking.Packets
|
||||
public uint RewardsVersion;
|
||||
}
|
||||
|
||||
public struct AddonChatThrottleParams
|
||||
public struct ChatThrottleParams
|
||||
{
|
||||
public int MaxTries;
|
||||
public int TriesRestoredPerSecond;
|
||||
@@ -362,6 +368,8 @@ namespace Game.Networking.Packets
|
||||
_worldPacket.WriteInt32(GameRules.Count);
|
||||
_worldPacket.WriteInt32(ActiveTimerunningSeasonID);
|
||||
_worldPacket.WriteInt32(RemainingTimerunningSeasonSeconds);
|
||||
_worldPacket.WriteInt32((int)TimerunningConversionMinCharacterAge.TotalSeconds);
|
||||
_worldPacket.WriteInt32(TimerunningConversionMaxSeasonID);
|
||||
_worldPacket.WriteInt16(MaxPlayerGuidLookupsPerRequest);
|
||||
_worldPacket.WriteInt16(NameLookupTelemetryInterval);
|
||||
_worldPacket.WriteUInt32((uint)NotFoundCacheTimeSeconds.TotalSeconds);
|
||||
@@ -429,6 +437,8 @@ namespace Game.Networking.Packets
|
||||
public List<GameRuleValuePair> GameRules = new();
|
||||
public int ActiveTimerunningSeasonID;
|
||||
public int RemainingTimerunningSeasonSeconds;
|
||||
public TimeSpan TimerunningConversionMinCharacterAge = TimeSpan.FromDays(1);
|
||||
public int TimerunningConversionMaxSeasonID = -1;
|
||||
public short MaxPlayerGuidLookupsPerRequest = 50;
|
||||
public short NameLookupTelemetryInterval = 600;
|
||||
public TimeSpan NotFoundCacheTimeSeconds = TimeSpan.FromSeconds(10);
|
||||
@@ -439,6 +449,18 @@ namespace Game.Networking.Packets
|
||||
public string RealmHiddenAlert;
|
||||
}
|
||||
|
||||
class MirrorVars() : ServerPacket(ServerOpcodes.MirrorVars)
|
||||
{
|
||||
public MirrorVarSingle[] Variables;
|
||||
|
||||
public override void Write()
|
||||
{
|
||||
_worldPacket.WriteInt32(Variables.Length);
|
||||
foreach (MirrorVarSingle variable in Variables)
|
||||
variable.Write(_worldPacket);
|
||||
}
|
||||
}
|
||||
|
||||
public class SetTimeZoneInformation : ServerPacket
|
||||
{
|
||||
public SetTimeZoneInformation() : base(ServerOpcodes.SetTimeZoneInformation) { }
|
||||
@@ -524,4 +546,29 @@ namespace Game.Networking.Packets
|
||||
data.WriteString(Text);
|
||||
}
|
||||
}
|
||||
|
||||
public struct MirrorVarSingle
|
||||
{
|
||||
public string Name;
|
||||
public string Value;
|
||||
public int UpdateType;
|
||||
|
||||
public MirrorVarSingle(string name, string value, int updateType = 0)
|
||||
{
|
||||
Name = name;
|
||||
Value = value;
|
||||
UpdateType = updateType;
|
||||
}
|
||||
|
||||
public void Write(WorldPacket data)
|
||||
{
|
||||
data.WriteBits(UpdateType, 1);
|
||||
data.WriteBits(Name.GetByteCount(), 24);
|
||||
data.WriteBits(Value.GetByteCount(), 24);
|
||||
data.FlushBits();
|
||||
|
||||
data.WriteCString(Name);
|
||||
data.WriteCString(Value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -224,6 +224,7 @@ namespace Game.Networking.Packets
|
||||
public List<ushort> GlyphIDs = new();
|
||||
public sbyte Role;
|
||||
public int PrimarySpecialization;
|
||||
public bool Unused1125;
|
||||
|
||||
public void Write(WorldPacket data)
|
||||
{
|
||||
@@ -241,6 +242,9 @@ namespace Game.Networking.Packets
|
||||
|
||||
foreach (ushort id in GlyphIDs)
|
||||
data.WriteUInt16(id);
|
||||
|
||||
data.WriteBit(Unused1125);
|
||||
data.FlushBits();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -32,8 +32,8 @@ namespace Game.Networking.Packets
|
||||
{
|
||||
_worldPacket.WriteUInt64(auctionableTokenAuctionable.Id);
|
||||
_worldPacket.WriteInt64(auctionableTokenAuctionable.LastUpdate);
|
||||
_worldPacket.WriteUInt64(auctionableTokenAuctionable.Price);
|
||||
_worldPacket.WriteUInt32(auctionableTokenAuctionable.Status);
|
||||
_worldPacket.WriteUInt64(auctionableTokenAuctionable.Price);
|
||||
_worldPacket.WriteUInt32(auctionableTokenAuctionable.DurationLeft);
|
||||
}
|
||||
}
|
||||
@@ -70,15 +70,15 @@ namespace Game.Networking.Packets
|
||||
|
||||
public override void Write()
|
||||
{
|
||||
_worldPacket.WriteUInt64(PriceGuarantee);
|
||||
_worldPacket.WriteUInt32(ClientToken);
|
||||
_worldPacket.WriteUInt32((uint)ServerToken);
|
||||
_worldPacket.WriteUInt64(PriceGuarantee);
|
||||
_worldPacket.WriteUInt32(PriceLockDurationSeconds);
|
||||
}
|
||||
|
||||
public ulong PriceGuarantee;
|
||||
public uint ClientToken;
|
||||
public TokenResult ServerToken;
|
||||
public ulong PriceGuarantee;
|
||||
public uint PriceLockDurationSeconds;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -130,6 +130,7 @@ namespace Game.Networking.Packets
|
||||
TraitNodeEntryID = ufEntry.TraitNodeEntryID;
|
||||
Rank = ufEntry.Rank;
|
||||
GrantedRanks = ufEntry.GrantedRanks;
|
||||
BonusRanks = ufEntry.BonusRanks;
|
||||
}
|
||||
|
||||
public void Read(WorldPacket data)
|
||||
@@ -205,6 +206,7 @@ namespace Game.Networking.Packets
|
||||
public int LocalIdentifier; // Local to specialization
|
||||
public uint SkillLineID;
|
||||
public uint TraitSystemID;
|
||||
public int VariationID;
|
||||
public List<TraitEntryPacket> Entries = new();
|
||||
public List<TraitSubTreeCachePacket> SubTrees = new();
|
||||
public string Name = "";
|
||||
@@ -220,6 +222,7 @@ namespace Game.Networking.Packets
|
||||
LocalIdentifier = ufConfig.LocalIdentifier;
|
||||
SkillLineID = (uint)(int)ufConfig.SkillLineID;
|
||||
TraitSystemID = ufConfig.TraitSystemID;
|
||||
VariationID = ufConfig.VariationID;
|
||||
foreach (TraitEntry ufEntry in ufConfig.Entries)
|
||||
Entries.Add(new TraitEntryPacket(ufEntry));
|
||||
foreach (var ufSubTree in ufConfig.SubTrees)
|
||||
@@ -246,6 +249,7 @@ namespace Game.Networking.Packets
|
||||
break;
|
||||
case TraitConfigType.Generic:
|
||||
TraitSystemID = data.ReadUInt32();
|
||||
VariationID = data.ReadInt32();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -289,6 +293,7 @@ namespace Game.Networking.Packets
|
||||
break;
|
||||
case TraitConfigType.Generic:
|
||||
data.WriteUInt32(TraitSystemID);
|
||||
data.WriteInt32(VariationID);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
@@ -262,6 +262,9 @@ namespace Game.Spells
|
||||
else if (!auraData.Flags.HasFlag(AuraFlags.NoCaster))
|
||||
auraData.CastUnit = aura.GetCasterGUID();
|
||||
|
||||
if (!aura.GetCastItemGUID().IsEmpty())
|
||||
auraData.CastItem = aura.GetCastItemGUID();
|
||||
|
||||
if (auraData.Flags.HasFlag(AuraFlags.Duration))
|
||||
{
|
||||
auraData.Duration = aura.GetMaxDuration();
|
||||
|
||||
@@ -5935,13 +5935,29 @@ namespace Game.Spells
|
||||
return;
|
||||
|
||||
newConfig.TraitSystemID = CliDB.TraitTreeStorage.LookupByKey(effectInfo.MiscValue).TraitSystemID;
|
||||
int existingConfigForSystem = target.m_activePlayerData.TraitConfigs.FindIndexIf(config =>
|
||||
TraitSystemRecord traitSystem = CliDB.TraitSystemStorage.LookupByKey(newConfig.TraitSystemID);
|
||||
if (traitSystem == null)
|
||||
return;
|
||||
|
||||
switch (traitSystem.GetVariationType())
|
||||
{
|
||||
case TraitSystemVariationType.None:
|
||||
newConfig.VariationID = 0;
|
||||
break;
|
||||
case TraitSystemVariationType.Spec:
|
||||
newConfig.VariationID = (int)target.GetPrimarySpecialization();
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
||||
int existingConfigIdForSystem = target.m_activePlayerData.TraitConfigs.FindIf(config =>
|
||||
{
|
||||
return config.Type == (int)TraitConfigType.Generic
|
||||
&& config.TraitSystemID == newConfig.TraitSystemID;
|
||||
});
|
||||
}).Item1;
|
||||
|
||||
if (existingConfigForSystem < 0)
|
||||
if (existingConfigIdForSystem == 0)
|
||||
target.CreateTraitConfig(newConfig);
|
||||
}
|
||||
|
||||
|
||||
@@ -139,7 +139,7 @@ namespace Game
|
||||
if (tree != null)
|
||||
tree.SubTrees.Add(subTree);
|
||||
|
||||
_traitSubTrees[(int)traitSubTree.ID] = subTree;
|
||||
_traitSubTrees[(int)traitSubTree.Id] = subTree;
|
||||
}
|
||||
|
||||
foreach (var (_, traitNodeGroup) in CliDB.TraitNodeGroupStorage)
|
||||
@@ -470,6 +470,12 @@ namespace Game
|
||||
}
|
||||
}
|
||||
break;
|
||||
case TraitCurrencyType.TraitSourcedPlayerDataElement:
|
||||
if (currency.PlayerDataElementAccountID != 0)
|
||||
currencies[currency.Id] += player.GetDataElementAccount((uint)currency.CurrencyTypesID);
|
||||
else if (currency.PlayerDataElementCharacterID != 0)
|
||||
currencies[currency.Id] += player.GetDataElementCharacter((uint)currency.CurrencyTypesID);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user