Core/DataStores: Updated to 11.0.0

Port From (https://github.com/TrinityCore/TrinityCore/commit/df511503815b7798c83acbffbb1ce5208f189ce7)
This commit is contained in:
Hondacrx
2024-09-02 22:27:11 -04:00
parent f38ad4607e
commit 2590e31d57
36 changed files with 407 additions and 208 deletions
@@ -182,6 +182,7 @@ namespace Game.Achievements
case CriteriaType.HighestHealReceived:
case CriteriaType.AnyArtifactPowerRankPurchased:
case CriteriaType.AzeriteLevelReached:
case CriteriaType.ReachRenownLevel:
SetCriteriaProgress(criteria, miscValue1, referencePlayer, ProgressType.Highest);
break;
case CriteriaType.ReachLevel:
@@ -3698,6 +3699,40 @@ namespace Game.Achievements
return false;
break;
}
case ModifierTreeType.PlayerHasActiveTraitSubTree: // 385
{
int traitConfigWithSubtree = referencePlayer.m_activePlayerData.TraitConfigs.FindIndexIf(traitConfig =>
{
if (traitConfig.Type == (int)TraitConfigType.Combat
&& (referencePlayer.m_activePlayerData.ActiveCombatTraitConfigID != traitConfig.ID
|| !traitConfig.CombatConfigFlags.GetValue().HasAnyFlag((int)TraitCombatConfigFlags.ActiveForSpec)))
return false;
return traitConfig.SubTrees.FindIndexIf(traitSubTree =>
{
return traitSubTree.TraitSubTreeID == reqValue && traitSubTree.Active != 0;
}) >= 0;
});
if (traitConfigWithSubtree < 0)
return false;
break;
}
case ModifierTreeType.TargetCreatureClassificationEqual: // 389
{
Creature targetCreature = refe?.ToCreature();
if (targetCreature == null)
return false;
if (targetCreature.GetCreatureClassification() != (CreatureClassifications)reqValue)
return false;
break;
}
case ModifierTreeType.PlayerHasCompletedQuestOrIsReadyToTurnIn: // 392
{
QuestStatus status = referencePlayer.GetQuestStatus(reqValue);
if (status != QuestStatus.Complete && status != QuestStatus.Rewarded)
return false;
break;
}
default:
return false;
}
+1 -1
View File
@@ -1256,7 +1256,7 @@ namespace Game.BattleGrounds
public uint GetMapId()
{
return (uint)_battlegroundTemplate.BattlemasterEntry.MapId[0];
return (uint)_battlegroundTemplate.MapIDs[0];
}
public void SetBgMap(BattlegroundMap map)
@@ -290,10 +290,10 @@ namespace Game.BattleGrounds
if (bgTypeId == BattlegroundTypeId.RB || bgTypeId == BattlegroundTypeId.AA || bgTypeId == BattlegroundTypeId.RandomEpic)
return null;
PvpDifficultyRecord bracketEntry = Global.DB2Mgr.GetBattlegroundBracketById((uint)bg_template.BattlemasterEntry.MapId[0], bracketId);
PvpDifficultyRecord bracketEntry = Global.DB2Mgr.GetBattlegroundBracketById((uint)bg_template.MapIDs[0], bracketId);
if (bracketEntry == null)
{
Log.outError(LogFilter.Battleground, $"Battleground: CreateNewBattleground: bg bracket entry not found for map {bg_template.BattlemasterEntry.MapId[0]} bracket id {bracketId}");
Log.outError(LogFilter.Battleground, $"Battleground: CreateNewBattleground: bg bracket entry not found for map {bg_template.MapIDs[0]} bracket id {bracketId}");
return null;
}
@@ -328,6 +328,11 @@ namespace Game.BattleGrounds
return;
}
MultiMap<BattlegroundTypeId, int> mapsByBattleground = new();
foreach (var (_, battlemasterListXMap) in CliDB.BattlemasterListXMapStorage)
if (CliDB.BattlemasterListStorage.HasRecord(battlemasterListXMap.BattlemasterListID) && CliDB.MapStorage.HasRecord((uint)battlemasterListXMap.MapID))
mapsByBattleground.Add((BattlegroundTypeId)battlemasterListXMap.BattlemasterListID, battlemasterListXMap.MapID);
uint count = 0;
do
{
@@ -351,6 +356,7 @@ namespace Game.BattleGrounds
bgTemplate.ScriptId = Global.ObjectMgr.GetScriptId(result.Read<string>(5));
bgTemplate.BattlemasterEntry = bl;
bgTemplate.MapIDs = mapsByBattleground[bgTypeId];
if (bgTemplate.Id != BattlegroundTypeId.AA && !IsRandomBattleground(bgTemplate.Id))
{
@@ -381,8 +387,8 @@ namespace Game.BattleGrounds
_battlegroundTemplates[bgTypeId] = bgTemplate;
if (bgTemplate.BattlemasterEntry.MapId[1] == -1) // in this case we have only one mapId
_battlegroundMapTemplates[(uint)bgTemplate.BattlemasterEntry.MapId[0]] = _battlegroundTemplates[bgTypeId];
if (bgTemplate.MapIDs.Count == 1)
_battlegroundMapTemplates[(uint)bgTemplate.MapIDs[0]] = _battlegroundTemplates[bgTypeId];
++count;
}
@@ -641,11 +647,8 @@ namespace Game.BattleGrounds
{
Dictionary<BattlegroundTypeId, float> selectionWeights = new();
foreach (var mapId in bgTemplate.BattlemasterEntry.MapId)
foreach (var mapId in bgTemplate.MapIDs)
{
if (mapId == -1)
break;
BattlegroundTemplate bg = GetBattlegroundTemplateByMapId((uint)mapId);
if (bg != null)
{
@@ -788,6 +791,7 @@ namespace Game.BattleGrounds
public byte Weight;
public uint ScriptId;
public BattlemasterListRecord BattlemasterEntry;
public List<int> MapIDs = new();
public bool IsArena() { return BattlemasterEntry.InstanceType == (uint)MapTypes.Arena; }
@@ -731,11 +731,8 @@ namespace Game.BattleGrounds
}
// loop over queues for every map
foreach (var mapId in bg_template.BattlemasterEntry.MapId)
foreach (var mapId in bg_template.MapIDs)
{
if (mapId == -1)
break;
var bgQueues = Global.BattlegroundMgr.GetBGFreeSlotQueueStore((uint)mapId);
foreach (var bg in bgQueues)
{
+2
View File
@@ -91,6 +91,7 @@ namespace Game.DataStorage
BattlePetSpeciesStorage = ReadDB2<BattlePetSpeciesRecord>("BattlePetSpecies.db2", HotfixStatements.SEL_BATTLE_PET_SPECIES, HotfixStatements.SEL_BATTLE_PET_SPECIES_LOCALE);
BattlePetSpeciesStateStorage = ReadDB2<BattlePetSpeciesStateRecord>("BattlePetSpeciesState.db2", HotfixStatements.SEL_BATTLE_PET_SPECIES_STATE);
BattlemasterListStorage = ReadDB2<BattlemasterListRecord>("BattlemasterList.db2", HotfixStatements.SEL_BATTLEMASTER_LIST, HotfixStatements.SEL_BATTLEMASTER_LIST_LOCALE);
BattlemasterListXMapStorage = ReadDB2<BattlemasterListXMapRecord>("BattlemasterListXMap.db2", HotfixStatements.SEL_BATTLEMASTER_LIST_X_MAP);
BroadcastTextStorage = ReadDB2<BroadcastTextRecord>("BroadcastText.db2", HotfixStatements.SEL_BROADCAST_TEXT, HotfixStatements.SEL_BROADCAST_TEXT_LOCALE);
BroadcastTextDurationStorage = ReadDB2<BroadcastTextDurationRecord>("BroadcastTextDuration.db2", HotfixStatements.SEL_BROADCAST_TEXT_DURATION);
CfgCategoriesStorage = ReadDB2<Cfg_CategoriesRecord>("Cfg_Categories.db2", HotfixStatements.SEL_CFG_CATEGORIES, HotfixStatements.SEL_CFG_CATEGORIES_LOCALE);
@@ -536,6 +537,7 @@ namespace Game.DataStorage
public static DB6Storage<BattlePetSpeciesRecord> BattlePetSpeciesStorage;
public static DB6Storage<BattlePetSpeciesStateRecord> BattlePetSpeciesStateStorage;
public static DB6Storage<BattlemasterListRecord> BattlemasterListStorage;
public static DB6Storage<BattlemasterListXMapRecord> BattlemasterListXMapStorage;
public static DB6Storage<BroadcastTextRecord> BroadcastTextStorage;
public static DB6Storage<BroadcastTextDurationRecord> BroadcastTextDurationStorage;
public static DB6Storage<Cfg_CategoriesRecord> CfgCategoriesStorage;
+3 -1
View File
@@ -892,7 +892,9 @@ namespace Game.DataStorage
public uint GetEmptyAnimStateID()
{
return AnimationDataStorage.GetNumRows();
return 1778;
// TEMP: well... AnimationData.db2 in 11.0.0 has more rows than max hardcoded anim id in client
//return AnimationDataStorage.GetNumRows();
}
public List<uint> GetAreasForGroup(uint areaGroupId)
+1 -1
View File
@@ -85,7 +85,7 @@ namespace Game.DataStorage
public uint Id;
public ushort Fallback;
public byte BehaviorTier;
public int BehaviorID;
public short BehaviorID;
public int[] Flags = new int[2];
}
+7 -1
View File
@@ -92,11 +92,17 @@ namespace Game.DataStorage
public int Flags;
public int IconFileDataID;
public int RequiredPlayerConditionID;
public short[] MapId = new short[16];
public bool HasFlag(BattlemasterListFlags battlemasterListFlags) { return (Flags & (int)battlemasterListFlags) != 0; }
}
public sealed class BattlemasterListXMapRecord
{
public uint ID;
public int MapID;
public uint BattlemasterListID;
}
public sealed class BroadcastTextRecord
{
public LocalizedString Text;
+13 -8
View File
@@ -36,10 +36,8 @@ namespace Game.DataStorage
public uint Id;
public int ItemBonusTreeGroupID;
public int DstItemBonusTreeID;
public sbyte Type;
public int Value;
public int MythicPlusSeasonID;
public int PvPSeasonID;
public int RequiredTimeEventPassed;
public uint SrcItemBonusTreeID;
}
@@ -198,6 +196,8 @@ namespace Game.DataStorage
public uint Id;
public ushort SecondaryID;
public int Flags;
public int ChrRacesID;
public int Sex;
public uint ChrModelID;
public int SortIndex;
public int ChrCustomizationCategoryID;
@@ -468,7 +468,7 @@ namespace Game.DataStorage
public int PortraitTextureFileDataID;
public ushort ObjectEffectPackageID;
public ushort AnimReplacementSetID;
public byte Flags;
public int Flags;
public int StateSpellVisualKitID;
public float PlayerOverrideScale;
public float PetInstanceScale; // scale of not own player pets inside dungeons/raids/scenarios
@@ -478,6 +478,9 @@ namespace Game.DataStorage
public sbyte Gender;
public int DissolveOutEffectID;
public sbyte CreatureModelMinLod;
public ushort ConditionalCreatureModelID;
public float Unknown_1100_1;
public ushort Unknown_1100_2;
public int[] TextureVariationFileDataID = new int[4];
}
@@ -510,7 +513,7 @@ namespace Game.DataStorage
{
public uint Id;
public float[] GeoBox = new float[6];
public uint Flags;
public int Flags;
public uint FileDataID;
public float WalkSpeed;
public float RunSpeed;
@@ -539,9 +542,10 @@ namespace Game.DataStorage
public float OverrideNameScale;
public float OverrideSelectionRadius;
public float TamedPetBaseScale;
public sbyte Unknown820_1; // scale related
public float Unknown820_2; // scale related
public float[] Unknown820_3 = new float[2]; // scale related
public sbyte MountScaleOtherIndex;
public float MountScaleSelf;
public ushort Unknown1100;
public float[] MountScaleOther = new float[2];
public bool HasFlag(CreatureModelDataFlags creatureModelDataFlags) { return (Flags & (uint)creatureModelDataFlags) != 0; }
}
@@ -617,6 +621,7 @@ namespace Game.DataStorage
public int MaxQtyWorldStateID;
public uint RechargingAmountPerCycle;
public uint RechargingCycleDurationMS;
public float AccountTransferPercentage;
public int[] Flags = new int[2];
public bool HasFlag(CurrencyTypesFlags currencyTypesFlags) { return (Flags[0] & (int)currencyTypesFlags) != 0; }
+1 -1
View File
@@ -43,7 +43,7 @@ namespace Game.DataStorage
public byte MinPlayers;
public byte MaxPlayers;
public ushort Flags;
public byte ItemContext;
public sbyte ItemContext;
public byte ToggleDifficultyID;
public uint GroupSizeHealthCurveID;
public uint GroupSizeDmgCurveID;
+3 -3
View File
@@ -8,9 +8,9 @@ namespace Game.DataStorage
public uint Id;
public long RaceMask;
public string EmoteSlashCommand;
public int AnimId;
public uint EmoteFlags;
public byte EmoteSpecProc;
public short AnimID;
public int EmoteFlags;
public int EmoteSpecProc;
public uint EmoteSpecProcParam;
public uint EventSoundID;
public uint SpellVisualKitId;
+1 -1
View File
@@ -39,7 +39,7 @@ namespace Game.DataStorage
public uint Id;
public ushort Faction;
public ushort Flags;
public int Flags;
public byte FactionGroup;
public byte FriendGroup;
public byte EnemyGroup;
+6 -4
View File
@@ -24,6 +24,7 @@ namespace Game.DataStorage
public int AlternateDisplayType;
public int ClientCreatureDisplayInfoID;
public int ClientItemID;
public ushort Unknown1100;
public Vector3 GeoBoxMin
{
@@ -50,6 +51,7 @@ namespace Game.DataStorage
public int PhaseUseFlags;
public int PhaseID;
public int PhaseGroupID;
public ushort Unknown1100;
public int[] PropValue = new int[8];
}
@@ -133,7 +135,7 @@ namespace Game.DataStorage
public byte AllianceGarrFollRaceID;
public uint HordeGarrClassSpecID;
public uint AllianceGarrClassSpecID;
public sbyte Quality;
public int Quality;
public byte FollowerLevel;
public ushort ItemLevelWeapon;
public ushort ItemLevelArmor;
@@ -206,7 +208,7 @@ namespace Game.DataStorage
{
public uint Id;
public string Name;
public byte PlotType;
public sbyte PlotType;
public uint HordeConstructObjID;
public uint AllianceConstructObjID;
public byte Flags;
@@ -293,7 +295,7 @@ namespace Game.DataStorage
{
public uint Id;
public uint SpellID;
public byte GlyphType;
public sbyte GlyphType;
public byte GlyphExclusiveCategoryID;
public uint SpellIconID;
}
@@ -311,7 +313,7 @@ namespace Game.DataStorage
public int GossipNpcOption;
public int LFGDungeonsID;
public int TrainerID;
public int GarrFollowerTypeID;
public sbyte GarrFollowerTypeID;
public int CharShipmentID;
public int GarrTalentTreeID;
public int UiMapID;
+5 -5
View File
@@ -52,7 +52,7 @@ namespace Game.DataStorage
public sealed class ItemAppearanceRecord
{
public uint Id;
public int DisplayType;
public sbyte DisplayType;
public uint ItemDisplayInfoID;
public int DefaultIconFileDataID;
public int UiOrder;
@@ -164,7 +164,7 @@ namespace Game.DataStorage
public sealed class ItemContextPickerEntryRecord
{
public uint Id;
public byte ItemCreationContext;
public sbyte ItemCreationContext;
public byte OrderIndex;
public int PVal;
public int LabelID;
@@ -329,7 +329,7 @@ namespace Game.DataStorage
public ushort RequiredSkillRank;
public uint RequiredAbility;
public ushort ItemLevel;
public int[] Flags = new int[4];
public int[] Flags = new int[5];
}
public sealed class ItemSetRecord
@@ -373,6 +373,7 @@ namespace Game.DataStorage
public float ItemRange;
public float[] StatPercentageOfSocket = new float[ItemConst.MaxStats];
public int[] StatPercentEditor = new int[ItemConst.MaxStats];
public int[] StatModifierBonusStat = new int[ItemConst.MaxStats];
public uint Stackable;
public uint MaxCount;
public uint MinReputation;
@@ -382,7 +383,7 @@ namespace Game.DataStorage
public uint VendorStackCount;
public float PriceVariance;
public float PriceRandomValue;
public int[] Flags = new int[4];
public int[] Flags = new int[5];
public uint FactionRelated;
public int ModifiedCraftingReagentItemID;
public uint ContentTuningID;
@@ -413,7 +414,6 @@ namespace Game.DataStorage
public byte PageMaterialID;
public byte Bonding;
public byte DamageType;
public sbyte[] StatModifierBonusStat = new sbyte[ItemConst.MaxStats];
public byte ContainerSlots;
public byte RequiredPVPMedal;
public byte RequiredPVPRank;
@@ -59,6 +59,7 @@ namespace Game.DataStorage
{
public uint Id;
public LocalizedString Name;
public int Expansion;
public int PlayerConditionID;
}
}
+4 -1
View File
@@ -38,6 +38,7 @@ namespace Game.DataStorage
public int ZmpFileDataID;
public int WdtFileDataID;
public int NavigationMaxDistance;
public int PreloadFileDataID;
public uint[] Flags = new uint[3];
// Helpers
@@ -127,7 +128,7 @@ namespace Game.DataStorage
public int LockID;
public MapDifficultyResetInterval ResetInterval;
public uint MaxPlayers;
public int ItemContext;
public byte ItemContext;
public uint ItemContextPickerID;
public int Flags;
public int ContentTuningID;
@@ -227,6 +228,7 @@ namespace Game.DataStorage
public uint Id;
public uint CreatureDisplayInfoID;
public uint PlayerConditionID;
public ushort Unknown1100;
public uint MountID;
}
@@ -244,6 +246,7 @@ namespace Game.DataStorage
{
public uint Id;
public int MilestoneSeason;
public int StartTimeEvent;
public int ExpansionLevel;
public int HeroicLFGDungeonMinGear;
}
+4 -4
View File
@@ -106,7 +106,7 @@ namespace Game.DataStorage
public sbyte ChrSpecializationRole;
public uint ModifierTreeID;
public sbyte PowerType;
public byte PowerTypeComp;
public sbyte PowerTypeComp;
public byte PowerTypeValue;
public int WeaponSubclassMask;
public byte MaxGuildLevel;
@@ -151,7 +151,7 @@ namespace Game.DataStorage
{
public uint Id;
public string GlobalStringBaseTag;
public byte ActualType;
public sbyte ActualType;
public byte Red;
public byte Green;
public byte Blue;
@@ -171,9 +171,9 @@ namespace Game.DataStorage
public int RegenInterruptTimeMS;
public float RegenPeace;
public float RegenCombat;
public short Flags;
public int Flags;
public bool HasFlag(PowerTypeFlags powerTypeFlags) { return (Flags & (short)powerTypeFlags) != 0; }
public bool HasFlag(PowerTypeFlags powerTypeFlags) { return (Flags & (int)powerTypeFlags) != 0; }
}
public sealed class PrestigeLevelInfoRecord
+19 -16
View File
@@ -19,9 +19,9 @@ namespace Game.DataStorage
public sealed class ScenarioStepRecord
{
public uint Id;
public string Description;
public string Title;
public uint Id;
public ushort ScenarioID;
public uint CriteriaTreeId;
public uint RewardQuestID;
@@ -88,7 +88,7 @@ namespace Game.DataStorage
public sbyte CanLink;
public uint ParentSkillLineID;
public int ParentTierIndex;
public ushort Flags;
public int Flags;
public int SpellBookSpellID;
public int ExpansionNameSharedStringID;
public int HordeExpansionNameSharedStringID;
@@ -133,8 +133,8 @@ namespace Game.DataStorage
public long RaceMask;
public ushort SkillID;
public int ClassMask;
public ushort Flags;
public sbyte Availability;
public int Flags;
public int Availability;
public sbyte MinLevel;
public ushort SkillTierID;
@@ -374,6 +374,7 @@ namespace Game.DataStorage
public string HordeName;
public int Duration;
public uint[] EffectArg = new uint[ItemConst.MaxItemEnchantmentEffects];
public int Flags;
public float[] EffectScalingPoints = new float[ItemConst.MaxItemEnchantmentEffects];
public uint IconFileDataID;
public int MinItemLevel;
@@ -382,7 +383,6 @@ namespace Game.DataStorage
public uint TransmogCost;
public ushort[] EffectPointsMin = new ushort[ItemConst.MaxItemEnchantmentEffects];
public ushort ItemVisual;
public ushort Flags;
public ushort RequiredSkillID;
public ushort RequiredSkillRank;
public ushort ItemLevel;
@@ -450,6 +450,7 @@ namespace Game.DataStorage
public byte DifficultyID;
public ushort CastingTimeIndex;
public ushort DurationIndex;
public ushort PvPDurationIndex;
public ushort RangeIndex;
public byte SchoolMask;
public float Speed;
@@ -647,6 +648,17 @@ namespace Game.DataStorage
public int DissolveEffectID;
public int ModelPosition;
public sbyte Unknown901;
public ushort Unknown1100;
}
public sealed class SpellVisualKitRecord
{
public uint ID;
public int ClutterLevel;
public int FallbackSpellVisualKitId;
public ushort DelayMin;
public ushort DelayMax;
public int[] Flags = new int[2];
}
public sealed class SpellVisualMissileRecord
@@ -666,21 +678,12 @@ namespace Game.DataStorage
public uint Flags;
public ushort SpellMissileMotionID;
public uint AnimKitID;
public sbyte ClutterLevel;
public int ClutterLevel;
public int DecayTimeAfterImpact;
public ushort Unused1100;
public uint SpellVisualMissileSetID;
}
public sealed class SpellVisualKitRecord
{
public uint Id;
public sbyte FallbackPriority;
public int FallbackSpellVisualKitId;
public ushort DelayMin;
public ushort DelayMax;
public int[] Flags = new int[2];
}
public sealed class SpellXSpellVisualRecord
{
public uint Id;
+10 -7
View File
@@ -125,6 +125,7 @@ namespace Game.DataStorage
public int RequiredLevel;
public int FreeSharedStringID;
public int SpendMoreSharedStringID;
public int TraitCondAccountElementID;
public TraitConditionType GetCondType() { return (TraitConditionType)CondType; }
}
@@ -199,8 +200,9 @@ namespace Game.DataStorage
public int TraitTreeID;
public int PosX;
public int PosY;
public sbyte Type;
public byte Type;
public int Flags;
public int TraitSubTreeID;
public TraitNodeType GetNodeType() { return (TraitNodeType)Type; }
}
@@ -211,6 +213,7 @@ namespace Game.DataStorage
public int TraitDefinitionID;
public int MaxRanks;
public byte NodeEntryType;
public int TraitSubTreeID;
public TraitNodeEntryType GetNodeEntryType() { return (TraitNodeEntryType)NodeEntryType; }
}
@@ -219,7 +222,7 @@ namespace Game.DataStorage
{
public uint Id;
public int TraitCondID;
public uint TraitNodeEntryID;
public int TraitNodeEntryID;
}
public sealed class TraitNodeEntryXTraitCostRecord
@@ -342,15 +345,15 @@ namespace Game.DataStorage
public string Name;
public uint Id;
public int ClassMask;
public uint TrackingQuestID;
public int TrackingQuestID;
public int Flags;
public uint TransmogSetGroupID;
public int ItemNameDescriptionID;
public ushort ParentTransmogSetID;
public byte Unknown810;
public byte ExpansionID;
public int ParentTransmogSetID;
public int Unknown810;
public int ExpansionID;
public int PatchID;
public short UiOrder;
public int UiOrder;
public uint PlayerConditionID;
}
+3 -2
View File
@@ -22,6 +22,7 @@ namespace Game.DataStorage
public int BkgAtlasID;
public int AlternateUiMapGroup;
public int ContentTuningID;
public int AdventureMapTextureKitID;
public bool HasFlag(UiMapFlag uiMapFlag) { return (Flags & (int)uiMapFlag) != 0; }
}
@@ -85,9 +86,9 @@ namespace Game.DataStorage
public sealed class UnitConditionRecord
{
public uint Id;
public byte Flags;
public int Flags;
public byte[] Variable = new byte[8];
public sbyte[] Op = new sbyte[8];
public byte[] Op = new byte[8];
public int[] Value = new int[8];
public bool HasFlag(UnitConditionFlags unitConditionFlags) { return (Flags & (byte)unitConditionFlags) != 0; }
+10 -10
View File
@@ -40,7 +40,7 @@ namespace Game.DataStorage
public int Flags;
public int FlagsB;
public int FlagsC;
public sbyte AttachmentID;
public int AttachmentID;
public float EnterPreDelay;
public float EnterSpeed;
public float EnterGravity;
@@ -48,12 +48,12 @@ namespace Game.DataStorage
public float EnterMaxDuration;
public float EnterMinArcHeight;
public float EnterMaxArcHeight;
public int EnterAnimStart;
public int EnterAnimLoop;
public int RideAnimStart;
public int RideAnimLoop;
public int RideUpperAnimStart;
public int RideUpperAnimLoop;
public short EnterAnimStart;
public short EnterAnimLoop;
public short RideAnimStart;
public short RideAnimLoop;
public short RideUpperAnimStart;
public short RideUpperAnimLoop;
public float ExitPreDelay;
public float ExitSpeed;
public float ExitGravity;
@@ -61,9 +61,9 @@ namespace Game.DataStorage
public float ExitMaxDuration;
public float ExitMinArcHeight;
public float ExitMaxArcHeight;
public int ExitAnimStart;
public int ExitAnimLoop;
public int ExitAnimEnd;
public short ExitAnimStart;
public short ExitAnimLoop;
public short ExitAnimEnd;
public short VehicleEnterAnim;
public sbyte VehicleEnterAnimBone;
public short VehicleExitAnim;
+14 -61
View File
@@ -163,82 +163,35 @@ namespace Game.Entities
public static uint GetBonusTreeIdOverride(uint itemBonusTreeId, ItemBonusGenerationParams generationParams)
{
// TODO: configure seasons globally
var mythicPlusSeason = CliDB.MythicPlusSeasonStorage.LookupByKey(0);
if (mythicPlusSeason != null)
List<int> passedTimeEvents = new(); // sorted by date TODO: configure globally
if (!passedTimeEvents.Empty())
{
int selectedLevel = -1;
int selectedMilestoneSeason = -1;
ChallengeModeItemBonusOverrideRecord selectedItemBonusOverride = null;
foreach (var itemBonusOverride in _challengeModeItemBonusOverrides.LookupByKey(itemBonusTreeId))
{
if (itemBonusOverride.Type != 0)
if (generationParams.MythicPlusKeystoneLevel != 0 && itemBonusOverride.Value > generationParams.MythicPlusKeystoneLevel)
continue;
if (itemBonusOverride.Value > generationParams.MythicPlusKeystoneLevel.GetValueOrDefault(-1))
if (generationParams.PvpTier != 0 && itemBonusOverride.Value > generationParams.PvpTier)
continue;
if (itemBonusOverride.MythicPlusSeasonID != 0)
if (itemBonusOverride.RequiredTimeEventPassed != 0)
{
var overrideSeason = CliDB.MythicPlusSeasonStorage.LookupByKey(itemBonusOverride.MythicPlusSeasonID);
if (overrideSeason == null)
continue;
var overrideMilestoneSeason = passedTimeEvents.IndexOf(itemBonusOverride.RequiredTimeEventPassed);
if (overrideMilestoneSeason == -1)
continue; // season not started yet
if (mythicPlusSeason.MilestoneSeason < overrideSeason.MilestoneSeason)
continue;
if (selectedMilestoneSeason > overrideMilestoneSeason)
continue; // older season that what was selected
if (selectedMilestoneSeason > overrideSeason.MilestoneSeason)
continue;
if (selectedMilestoneSeason == overrideSeason.MilestoneSeason)
if (selectedMilestoneSeason == overrideMilestoneSeason)
if (selectedLevel > itemBonusOverride.Value)
continue;
continue; // lower level in current season than what was already found
selectedMilestoneSeason = overrideSeason.MilestoneSeason;
}
else if (selectedLevel > itemBonusOverride.Value)
continue;
selectedLevel = itemBonusOverride.Value;
selectedItemBonusOverride = itemBonusOverride;
}
if (selectedItemBonusOverride != null && selectedItemBonusOverride.DstItemBonusTreeID != 0)
itemBonusTreeId = (uint)selectedItemBonusOverride.DstItemBonusTreeID;
}
// TODO: configure seasons globally
var pvpSeason = CliDB.PvpSeasonStorage.LookupByKey(0);
if (pvpSeason != null)
{
int selectedLevel = -1;
int selectedMilestoneSeason = -1;
ChallengeModeItemBonusOverrideRecord selectedItemBonusOverride = null;
foreach (var itemBonusOverride in _challengeModeItemBonusOverrides.LookupByKey(itemBonusTreeId))
{
if (itemBonusOverride.Type != 1)
continue;
if (itemBonusOverride.Value > generationParams.PvpTier.GetValueOrDefault(-1))
continue;
if (itemBonusOverride.PvPSeasonID != 0)
{
var overrideSeason = CliDB.PvpSeasonStorage.LookupByKey(itemBonusOverride.PvPSeasonID);
if (overrideSeason == null)
continue;
if (pvpSeason.MilestoneSeason < overrideSeason.MilestoneSeason)
continue;
if (selectedMilestoneSeason > overrideSeason.MilestoneSeason)
continue;
if (selectedMilestoneSeason == overrideSeason.MilestoneSeason)
if (selectedLevel > itemBonusOverride.Value)
continue;
selectedMilestoneSeason = overrideSeason.MilestoneSeason;
selectedMilestoneSeason = overrideMilestoneSeason;
}
else if (selectedLevel > itemBonusOverride.Value)
continue;
+6
View File
@@ -1445,7 +1445,11 @@ namespace Game.Entities
playerCurrency.EarnedQuantity += (uint)amount;
if (!isGainOnRefund)
{
UpdateCriteria(CriteriaType.CurrencyGained, id, (ulong)amount);
if (gainSource == CurrencyGainSource.RenownRepGain)
UpdateCriteria(CriteriaType.ReachRenownLevel, id, playerCurrency.Quantity);
}
}
CurrencyChanged(id, amount);
@@ -6514,6 +6518,8 @@ namespace Game.Entities
XP = Math.Max(minScaledXP, XP);
}
XP += (uint)(XP * GetTotalAuraMultiplier(AuraType.ModExplorationExperience));
GiveXP(XP, null);
SendExplorationExperience(areaId, XP);
}
+3
View File
@@ -1294,7 +1294,10 @@ namespace Game.Entities
// 30% damage blocked, double blocked amount if block is critical
damageInfo.Blocked = MathFunctions.CalculatePct(damageInfo.Damage, damageInfo.Target.GetBlockPercent(GetLevel()));
if (damageInfo.Target.IsBlockCritical())
{
damageInfo.Blocked *= 2;
damageInfo.Blocked *= (uint)GetTotalAuraMultiplier(AuraType.ModCriticalBlockAmount);
}
damageInfo.OriginalDamage = damageInfo.Damage;
damageInfo.Damage -= damageInfo.Blocked;
+6 -1
View File
@@ -293,6 +293,8 @@ namespace Game.Entities
// multiplicative bonus, for example Dispersion + Shadowform (0.10*0.85=0.085)
TakenTotalMod *= GetTotalAuraMultiplierByMiscMask(AuraType.ModDamagePercentTaken, (uint)spellProto.GetSchoolMask());
TakenTotalMod *= GetTotalAuraMultiplier(AuraType.ModDamageTakenByLabel, aurEff => spellProto.HasLabel((uint)aurEff.GetMiscValue()));
// From caster spells
if (caster != null)
{
@@ -306,7 +308,7 @@ namespace Game.Entities
return aurEff.GetCasterGUID() == caster.GetGUID() && aurEff.IsAffectingSpell(spellProto);
});
TakenTotalMod *= GetTotalAuraMultiplier(AuraType.ModDamageTakenFromCasterByLabel, aurEff =>
TakenTotalMod *= GetTotalAuraMultiplier(AuraType.ModSpellDamageFromCasterByLabel, aurEff =>
{
return aurEff.GetCasterGUID() == caster.GetGUID() && spellProto.HasLabel((uint)aurEff.GetMiscValue());
});
@@ -2182,7 +2184,10 @@ namespace Game.Entities
// double blocked amount if block is critical
float value = victim.GetBlockPercent(GetLevel());
if (victim.IsBlockCritical())
{
value *= 2; // double blocked percent
value *= GetTotalAuraMultiplier(AuraType.ModCriticalBlockAmount);
}
damageInfo.blocked = (uint)MathFunctions.CalculatePct(damage, value);
if (damage <= damageInfo.blocked)
{
+1 -1
View File
@@ -262,7 +262,7 @@ namespace Game.Entities
var emotesEntry = CliDB.EmotesStorage.LookupByKey(emoteId);
if (emotesEntry != null && spellVisualKitIds != null)
if (emotesEntry.AnimId == (uint)Anim.MountSpecial || emotesEntry.AnimId == (uint)Anim.MountSelfSpecial)
if (emotesEntry.AnimID == (uint)Anim.MountSpecial || emotesEntry.AnimID == (uint)Anim.MountSelfSpecial)
packet.SpellVisualKitIDs.AddRange(spellVisualKitIds);
packet.SequenceVariation = sequenceVariation;
+1 -1
View File
@@ -253,7 +253,7 @@ namespace Game.Garrisons
Plot plotInfo = _plots[garrPlotInstanceId];
plotInfo.PacketInfo.GarrPlotInstanceID = garrPlotInstanceId;
plotInfo.PacketInfo.PlotPos.Relocate(gameObject.Pos.X, gameObject.Pos.Y, gameObject.Pos.Z, 2 * (float)Math.Acos(gameObject.Rot[3]));
plotInfo.PacketInfo.PlotType = plot.PlotType;
plotInfo.PacketInfo.PlotType = (byte)plot.PlotType;
plotInfo.Rotation = new Quaternion(gameObject.Rot[0], gameObject.Rot[1], gameObject.Rot[2], gameObject.Rot[3]);
plotInfo.EmptyGameObjectId = gameObject.Id;
plotInfo.GarrSiteLevelPlotInstId = plots[i].Id;
+1 -1
View File
@@ -1187,7 +1187,7 @@ namespace Game.Groups
if (reference == null)
return GroupJoinBattlegroundResult.BattlegroundJoinFailed;
PvpDifficultyRecord bracketEntry = Global.DB2Mgr.GetBattlegroundBracketByLevel((uint)bgOrTemplate.BattlemasterEntry.MapId[0], reference.GetLevel());
PvpDifficultyRecord bracketEntry = Global.DB2Mgr.GetBattlegroundBracketByLevel((uint)bgOrTemplate.MapIDs[0], reference.GetLevel());
if (bracketEntry == null)
return GroupJoinBattlegroundResult.BattlegroundJoinFailed;
+4 -4
View File
@@ -80,7 +80,7 @@ namespace Game
return;
// expected bracket entry
PvpDifficultyRecord bracketEntry = Global.DB2Mgr.GetBattlegroundBracketByLevel((uint)bgTemplate.BattlemasterEntry.MapId[0], GetPlayer().GetLevel());
PvpDifficultyRecord bracketEntry = Global.DB2Mgr.GetBattlegroundBracketByLevel((uint)bgTemplate.MapIDs[0], GetPlayer().GetLevel());
if (bracketEntry == null)
return;
@@ -295,7 +295,7 @@ namespace Game
return;
}
uint mapId = (uint)bgTemplate.BattlemasterEntry.MapId[0];
uint mapId = (uint)bgTemplate.MapIDs[0];
// BGTemplateId returns Battleground_AA when it is arena queue.
// Do instance id search as there is no AA bg instances.
@@ -469,7 +469,7 @@ namespace Game
continue;
// expected bracket entry
PvpDifficultyRecord bracketEntry = Global.DB2Mgr.GetBattlegroundBracketByLevel((uint)bgTemplate.BattlemasterEntry.MapId[0], _player.GetLevel());
PvpDifficultyRecord bracketEntry = Global.DB2Mgr.GetBattlegroundBracketByLevel((uint)bgTemplate.MapIDs[0], _player.GetLevel());
if (bracketEntry == null)
continue;
@@ -506,7 +506,7 @@ namespace Game
BattlegroundTypeId bgTypeId = bgTemplate.Id;
BattlegroundQueueTypeId bgQueueTypeId = Global.BattlegroundMgr.BGQueueTypeId((ushort)bgTypeId, BattlegroundQueueIdType.Arena, true, arenatype);
PvpDifficultyRecord bracketEntry = Global.DB2Mgr.GetBattlegroundBracketByLevel((uint)bgTemplate.BattlemasterEntry.MapId[0], _player.GetLevel());
PvpDifficultyRecord bracketEntry = Global.DB2Mgr.GetBattlegroundBracketByLevel((uint)bgTemplate.MapIDs[0], _player.GetLevel());
if (bracketEntry == null)
return;
+18
View File
@@ -4743,6 +4743,24 @@ namespace Game.Spells
new StaticData(SpellEffectImplicitTargetTypes.Explicit, SpellTargetObjectTypes.Item), // 313 SPELL_EFFECT_CHANGE_ITEM_BONUSES_2
new StaticData(SpellEffectImplicitTargetTypes.None, SpellTargetObjectTypes.None), // 314 SPELL_EFFECT_ADD_SOCKET_BONUS
new StaticData(SpellEffectImplicitTargetTypes.Caster, SpellTargetObjectTypes.Unit), // 315 SPELL_EFFECT_LEARN_TRANSMOG_APPEARANCE_FROM_ITEM_MOD_APPEARANCE_GROUP
new StaticData(SpellEffectImplicitTargetTypes.Explicit, SpellTargetObjectTypes.Unit), // 316 SPELL_EFFECT_KILL_CREDIT_LABEL_1
new StaticData(SpellEffectImplicitTargetTypes.Explicit, SpellTargetObjectTypes.Unit), // 317 SPELL_EFFECT_KILL_CREDIT_LABEL_2
new StaticData(SpellEffectImplicitTargetTypes.None, SpellTargetObjectTypes.None), // 318 SPELL_EFFECT_318
new StaticData(SpellEffectImplicitTargetTypes.None, SpellTargetObjectTypes.None), // 319 SPELL_EFFECT_319
new StaticData(SpellEffectImplicitTargetTypes.None, SpellTargetObjectTypes.None), // 320 SPELL_EFFECT_320
new StaticData(SpellEffectImplicitTargetTypes.None, SpellTargetObjectTypes.None), // 321 SPELL_EFFECT_321
new StaticData(SpellEffectImplicitTargetTypes.None, SpellTargetObjectTypes.None), // 322 SPELL_EFFECT_322
new StaticData(SpellEffectImplicitTargetTypes.None, SpellTargetObjectTypes.None), // 323 SPELL_EFFECT_323
new StaticData(SpellEffectImplicitTargetTypes.None, SpellTargetObjectTypes.None), // 324 SPELL_EFFECT_324
new StaticData(SpellEffectImplicitTargetTypes.None, SpellTargetObjectTypes.None), // 325 SPELL_EFFECT_325
new StaticData(SpellEffectImplicitTargetTypes.None, SpellTargetObjectTypes.None), // 326 SPELL_EFFECT_326
new StaticData(SpellEffectImplicitTargetTypes.None, SpellTargetObjectTypes.None), // 327 SPELL_EFFECT_327
new StaticData(SpellEffectImplicitTargetTypes.None, SpellTargetObjectTypes.None), // 328 SPELL_EFFECT_328
new StaticData(SpellEffectImplicitTargetTypes.None, SpellTargetObjectTypes.None), // 329 SPELL_EFFECT_329
new StaticData(SpellEffectImplicitTargetTypes.None, SpellTargetObjectTypes.None), // 330 SPELL_EFFECT_330
new StaticData(SpellEffectImplicitTargetTypes.None, SpellTargetObjectTypes.None), // 331 SPELL_EFFECT_331
new StaticData(SpellEffectImplicitTargetTypes.None, SpellTargetObjectTypes.None), // 332 SPELL_EFFECT_332
new StaticData(SpellEffectImplicitTargetTypes.None, SpellTargetObjectTypes.None), // 333 SPELL_EFFECT_333
};
#region Fields