From 958ab1dfbb15cf81d0a0f9c7cf83a2fac6bcfbf5 Mon Sep 17 00:00:00 2001 From: hondacrx Date: Wed, 31 Jan 2024 22:50:42 -0500 Subject: [PATCH] Fixes server loading. --- Source/Game/Achievements/CriteriaHandler.cs | 7 +++++++ Source/Game/Globals/ObjectManager.cs | 2 +- Source/Scripts/Spells/Generic.cs | 6 +++--- Source/Scripts/World/EmeraldDragons.cs | 1 - 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/Source/Game/Achievements/CriteriaHandler.cs b/Source/Game/Achievements/CriteriaHandler.cs index 3b722b1e6..399300cb3 100644 --- a/Source/Game/Achievements/CriteriaHandler.cs +++ b/Source/Game/Achievements/CriteriaHandler.cs @@ -3706,6 +3706,13 @@ namespace Game.Achievements _criteriasByAsset[i] = new MultiMap(); _scenarioCriteriasByTypeAndScenarioId[i] = new MultiMap(); } + + for (var i = 0; i < (int)CriteriaStartEvent.Max; ++i) + _criteriasByStartEvent[i] = new(); + + for (var i = 0; i < (int)CriteriaFailEvent.Max; ++i) + _criteriasByFailEvent[i] = new(); + } public void LoadCriteriaModifiersTree() diff --git a/Source/Game/Globals/ObjectManager.cs b/Source/Game/Globals/ObjectManager.cs index ea3695e14..240cd70fd 100644 --- a/Source/Game/Globals/ObjectManager.cs +++ b/Source/Game/Globals/ObjectManager.cs @@ -2071,7 +2071,7 @@ namespace Game continue; } - if (creatureSummonedDataStorage.ContainsKey(creatureId)) + if (!creatureSummonedDataStorage.ContainsKey(creatureId)) creatureSummonedDataStorage[creatureId] = new(); CreatureSummonedData summonedData = creatureSummonedDataStorage[creatureId]; diff --git a/Source/Scripts/Spells/Generic.cs b/Source/Scripts/Spells/Generic.cs index 14b6c0fee..be5ed35db 100644 --- a/Source/Scripts/Spells/Generic.cs +++ b/Source/Scripts/Spells/Generic.cs @@ -189,7 +189,7 @@ namespace Scripts.Spells.Generic public override bool Validate(SpellInfo spellInfo) { - if (!ValidateSpellEffect((spellInfo.Id, 0)) || spellInfo.GetEffect(0).IsAura(AuraType.ModPowerRegen)) + if (!ValidateSpellEffect((spellInfo.Id, 0)) || !spellInfo.GetEffect(0).IsAura(AuraType.ModPowerRegen)) { Log.outError(LogFilter.Spells, $"Aura {GetId()} structure has been changed - first aura is no longer AuraType.ModPowerRegen"); return false; @@ -1207,7 +1207,7 @@ namespace Scripts.Spells.Generic public override void Register() { - SpellInfo spell = SpellMgr.GetSpellInfo(m_scriptSpellId, Difficulty.None); + /*SpellInfo spell = SpellMgr.GetSpellInfo(m_scriptSpellId, Difficulty.None); // 6.x effects Removed @@ -1227,7 +1227,7 @@ namespace Scripts.Spells.Generic { AfterEffectApply.Add(new(RefreshVisualShields, 1, AuraType.Dummy, AuraEffectHandleModes.RealOrReapplyMask)); OnEffectRemove.Add(new(RemoveVisualShields, 1, AuraType.Dummy, AuraEffectHandleModes.ChangeAmountMask)); - } + }*/ } } diff --git a/Source/Scripts/World/EmeraldDragons.cs b/Source/Scripts/World/EmeraldDragons.cs index fc6aaf149..64f85ecef 100644 --- a/Source/Scripts/World/EmeraldDragons.cs +++ b/Source/Scripts/World/EmeraldDragons.cs @@ -80,7 +80,6 @@ namespace Scripts.World.Achievements public const uint SayTaerarSummonShades = 1; } - [Script] class emerald_dragon : WorldBossAI { public emerald_dragon(Creature creature) : base(creature) { }