Core/DataStores: Updated to 11.0.0
Port From (https://github.com/TrinityCore/TrinityCore/commit/df511503815b7798c83acbffbb1ce5208f189ce7)
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user