diff --git a/Source/Framework/Constants/Spells/SpellConst.cs b/Source/Framework/Constants/Spells/SpellConst.cs index 276295881..f4b5af0c1 100644 --- a/Source/Framework/Constants/Spells/SpellConst.cs +++ b/Source/Framework/Constants/Spells/SpellConst.cs @@ -1193,12 +1193,17 @@ namespace Framework.Constants IgnoreCasterAurastate = 0x800, //! Will Ignore Caster Aura States Including Combat Requirements And Death State DisallowProcEvents = 0x1000, //! Disallows proc events from triggered spell (default) IgnoreCasterMountedOrOnVehicle = 0x2000, //! Will Ignore Mounted/On Vehicle Restrictions + // reuse = 0x00004000, + // reuse = 0x00008000, IgnoreCasterAuras = 0x10000, //! Will Ignore Caster Aura Restrictions Or Requirements DontResetPeriodicTimer = 0x20000, //! Will allow periodic aura timers to keep ticking (instead of resetting) DontReportCastError = 0x40000, //! Will Return SpellFailedDontReport In Checkcast Functions - IgnoreEquippedItemRequirement = 0x80000, - IgnoreTargetCheck = 0x100000, - FullMask = 0xffffffff + FullMask = 0x0007FFFF, //! Used when doing CastSpell with triggered == true + + // debug flags (used with .cast triggered commands) + IgnoreEquippedItemRequirement = 0x80000, //! Will ignore equipped item requirements + IgnoreTargetCheck = 0x100000, //! Will ignore most target checks (mostly DBC target checks) + FullDebugMask = 0xFFFFFFFF } public enum SpellSchoolMask diff --git a/Source/Game/AI/ScriptedAI/ScriptedEscortAI.cs b/Source/Game/AI/ScriptedAI/ScriptedEscortAI.cs index 30b8161d1..cf754acb7 100644 --- a/Source/Game/AI/ScriptedAI/ScriptedEscortAI.cs +++ b/Source/Game/AI/ScriptedAI/ScriptedEscortAI.cs @@ -530,7 +530,7 @@ namespace Game.AI float MaxPlayerDistance; uint LastWP; - WaypointPath _path; + WaypointPath _path = new WaypointPath(); Quest m_pQuestForEscort; //generally passed in Start() when regular escort script. diff --git a/Source/Game/DataStorage/Structs/S_Records.cs b/Source/Game/DataStorage/Structs/S_Records.cs index b00fdb05f..addea0020 100644 --- a/Source/Game/DataStorage/Structs/S_Records.cs +++ b/Source/Game/DataStorage/Structs/S_Records.cs @@ -478,7 +478,7 @@ namespace Game.DataStorage public uint Id; public uint SpellID; public ushort ScalesFromItemLevel; - public byte Class; + public sbyte Class; public byte MinScalingLevel; public uint MaxScalingLevel; } diff --git a/Source/Game/Entities/Unit/Unit.Spells.cs b/Source/Game/Entities/Unit/Unit.Spells.cs index 07b2af2e8..8afbde236 100644 --- a/Source/Game/Entities/Unit/Unit.Spells.cs +++ b/Source/Game/Entities/Unit/Unit.Spells.cs @@ -2872,7 +2872,7 @@ namespace Game.Entities return null; } - public bool HandleSpellClick(Unit clicker, sbyte seatId = 0) + public bool HandleSpellClick(Unit clicker, sbyte seatId = -1) { bool result = false; diff --git a/Source/Game/Movement/Generators/WaypointMovement.cs b/Source/Game/Movement/Generators/WaypointMovement.cs index 3a0922b32..b4939ce54 100644 --- a/Source/Game/Movement/Generators/WaypointMovement.cs +++ b/Source/Game/Movement/Generators/WaypointMovement.cs @@ -326,6 +326,9 @@ namespace Game.Movement void FormationMove(Creature creature) { + if (path == null || path.nodes.Empty()) + return; + bool transportPath = creature.GetTransport() != null; WaypointNode waypoint = path.nodes.LookupByIndex((int)currentNode); diff --git a/Source/Game/Spells/Auras/Aura.cs b/Source/Game/Spells/Auras/Aura.cs index ad1828cb0..5e5f4d069 100644 --- a/Source/Game/Spells/Auras/Aura.cs +++ b/Source/Game/Spells/Auras/Aura.cs @@ -1694,6 +1694,7 @@ namespace Game.Spells return 0; // do checks against db data + if (!SpellManager.CanSpellTriggerProcOnEvent(procEntry, eventInfo)) return 0; diff --git a/Source/Game/Spells/SpellEffects.cs b/Source/Game/Spells/SpellEffects.cs index 1cc62e389..3471a11ee 100644 --- a/Source/Game/Spells/SpellEffects.cs +++ b/Source/Game/Spells/SpellEffects.cs @@ -513,7 +513,6 @@ namespace Game.Spells // normal case SpellInfo spellInfo = Global.SpellMgr.GetSpellInfo(triggered_spell_id); - if (spellInfo == null) { Log.outError(LogFilter.Spells, "Spell.EffectForceCast of spell {0}: triggering unknown spell id {1}", m_spellInfo.Id, triggered_spell_id); diff --git a/Source/Game/Spells/SpellInfo.cs b/Source/Game/Spells/SpellInfo.cs index 5a5b2ef92..46ef4ff52 100644 --- a/Source/Game/Spells/SpellInfo.cs +++ b/Source/Game/Spells/SpellInfo.cs @@ -3792,7 +3792,6 @@ namespace Game.Spells int basePoints = bp.HasValue ? bp.Value : BasePoints; float comboDamage = PointsPerResource; - float value; // base amount modification based on spell lvl vs caster lvl if (Scaling.Coefficient != 0.0f) { @@ -3811,7 +3810,7 @@ namespace Game.Spells if (_spellInfo.Scaling.MaxScalingLevel != 0 && _spellInfo.Scaling.MaxScalingLevel < level) level = _spellInfo.Scaling.MaxScalingLevel; - value = 0.0f; + float tempValue = 0.0f; if (level > 0) { if (_spellInfo.Scaling._Class == 0) @@ -3820,40 +3819,40 @@ namespace Game.Spells if (_spellInfo.Scaling.ScalesFromItemLevel == 0) { if (!_spellInfo.HasAttribute(SpellAttr11.ScalesWithItemLevel)) - value = CliDB.GetSpellScalingColumnForClass(CliDB.SpellScalingGameTable.GetRow(level), _spellInfo.Scaling._Class); + tempValue = CliDB.GetSpellScalingColumnForClass(CliDB.SpellScalingGameTable.GetRow(level), _spellInfo.Scaling._Class); else { uint effectiveItemLevel = (uint)(itemLevel != -1 ? itemLevel : 1); - value = ItemEnchantment.GetRandomPropertyPoints(effectiveItemLevel, ItemQuality.Rare, InventoryType.Chest, 0); + tempValue = ItemEnchantment.GetRandomPropertyPoints(effectiveItemLevel, ItemQuality.Rare, InventoryType.Chest, 0); if (IsAura() && ApplyAuraName == AuraType.ModRating) { GtCombatRatingsMultByILvlRecord ratingMult = CliDB.CombatRatingsMultByILvlGameTable.GetRow(effectiveItemLevel); if (ratingMult != null) - value *= ratingMult.ArmorMultiplier; + tempValue *= ratingMult.ArmorMultiplier; } } } else - value = ItemEnchantment.GetRandomPropertyPoints(_spellInfo.Scaling.ScalesFromItemLevel, ItemQuality.Rare, InventoryType.Chest, 0); + tempValue = ItemEnchantment.GetRandomPropertyPoints(_spellInfo.Scaling.ScalesFromItemLevel, ItemQuality.Rare, InventoryType.Chest, 0); } - value *= Scaling.Coefficient; - if (value != 0.0f && value < 1.0f) - value = 1.0f; + tempValue *= Scaling.Coefficient; + if (tempValue != 0.0f && tempValue < 1.0f) + tempValue = 1.0f; if (Scaling.Variance != 0f) { float delta = Math.Abs(Scaling.Variance * 0.5f); float valueVariance = RandomHelper.FRand(-delta, delta); - value += value * valueVariance; + tempValue += tempValue * valueVariance; variance = valueVariance; } - basePoints = (int)Math.Round(value); + basePoints = (int)Math.Round(tempValue); if (Scaling.ResourceCoefficient != 0f) - comboDamage = Scaling.ResourceCoefficient * value; + comboDamage = Scaling.ResourceCoefficient * tempValue; } else { @@ -3889,7 +3888,7 @@ namespace Game.Spells } } - value = basePoints; + float value = (float)basePoints; // random damage if (caster != null) @@ -3954,6 +3953,7 @@ namespace Game.Spells } } } + return (int)value; }