diff --git a/Source/Game/AI/CoreAI/GuardAI.cs b/Source/Game/AI/CoreAI/GuardAI.cs index 3d5c34764..aeea572ab 100644 --- a/Source/Game/AI/CoreAI/GuardAI.cs +++ b/Source/Game/AI/CoreAI/GuardAI.cs @@ -58,9 +58,7 @@ namespace Game.AI me.GetThreatManager().ClearAllThreat(); me.CombatStop(true); - // Remove ChaseMovementGenerator from MotionMaster stack list, and add HomeMovementGenerator instead - if (me.GetMotionMaster().GetCurrentMovementGeneratorType() == MovementGeneratorType.Chase) - me.GetMotionMaster().MoveTargetedHome(); + me.GetMotionMaster().MoveTargetedHome(); } public override void JustDied(Unit killer) diff --git a/Source/Game/Entities/Creature/Creature.cs b/Source/Game/Entities/Creature/Creature.cs index 7821cdc8d..25b47db5c 100644 --- a/Source/Game/Entities/Creature/Creature.cs +++ b/Source/Game/Entities/Creature/Creature.cs @@ -1941,104 +1941,6 @@ namespace Game.Entities return Convert.ToBoolean(GetCreatureTemplate().TypeFlags & CreatureTypeFlags.BossMob); } - public SpellInfo ReachWithSpellAttack(Unit victim) - { - if (victim == null) - return null; - - for (uint i = 0; i < SharedConst.MaxCreatureSpells; ++i) - { - if (m_spells[i] == 0) - continue; - SpellInfo spellInfo = Global.SpellMgr.GetSpellInfo(m_spells[i], GetMap().GetDifficultyID()); - if (spellInfo == null) - { - Log.outError(LogFilter.Unit, "WORLD: unknown spell id {0}", m_spells[i]); - continue; - } - - bool bcontinue = true; - foreach (SpellEffectInfo effect in spellInfo.GetEffects()) - { - if (effect != null && ((effect.Effect == SpellEffectName.SchoolDamage) || (effect.Effect == SpellEffectName.Instakill) - || (effect.Effect == SpellEffectName.EnvironmentalDamage) || (effect.Effect == SpellEffectName.HealthLeech))) - { - bcontinue = false; - break; - } - } - if (bcontinue) - continue; - - var costs = spellInfo.CalcPowerCost(this, spellInfo.SchoolMask); - var m = costs.Find(cost => cost.Power == PowerType.Mana); - if (m != null) - if (m.Amount > GetPower(PowerType.Mana)) - continue; - - float range = spellInfo.GetMaxRange(false); - float minrange = spellInfo.GetMinRange(false); - float dist = GetDistance(victim); - if (dist > range || dist < minrange) - continue; - if (spellInfo.PreventionType.HasAnyFlag(SpellPreventionType.Silence) && HasUnitFlag(UnitFlags.Silenced)) - continue; - if (spellInfo.PreventionType.HasAnyFlag(SpellPreventionType.Pacify) && HasUnitFlag(UnitFlags.Pacified)) - continue; - return spellInfo; - } - return null; - } - - SpellInfo ReachWithSpellCure(Unit victim) - { - if (victim == null) - return null; - - for (uint i = 0; i < SharedConst.MaxCreatureSpells; ++i) - { - if (m_spells[i] == 0) - continue; - SpellInfo spellInfo = Global.SpellMgr.GetSpellInfo(m_spells[i], GetMap().GetDifficultyID()); - if (spellInfo == null) - { - Log.outError(LogFilter.Unit, "WORLD: unknown spell id {0}", m_spells[i]); - continue; - } - - bool bcontinue = true; - foreach (SpellEffectInfo effect in spellInfo.GetEffects()) - { - if (effect != null && effect.Effect == SpellEffectName.Heal) - { - bcontinue = false; - break; - } - } - if (bcontinue) - continue; - - var costs = spellInfo.CalcPowerCost(this, spellInfo.SchoolMask); - var m = costs.Find(cost => cost.Power == PowerType.Mana); - if (m != null) - if (m.Amount > GetPower(PowerType.Mana)) - continue; - - float range = spellInfo.GetMaxRange(true); - float minrange = spellInfo.GetMinRange(true); - float dist = GetDistance(victim); - - if (dist > range || dist < minrange) - continue; - if (spellInfo.PreventionType.HasAnyFlag(SpellPreventionType.Silence) && HasUnitFlag(UnitFlags.Silenced)) - continue; - if (spellInfo.PreventionType.HasAnyFlag(SpellPreventionType.Pacify) && HasUnitFlag(UnitFlags.Pacified)) - continue; - return spellInfo; - } - return null; - } - // select nearest hostile unit within the given distance (regardless of threat list). public Unit SelectNearestTarget(float dist = 0) { diff --git a/sql/updates/world/master/2021_02_08_05_world_2017_11_22_03_world.sql b/sql/updates/world/master/2021_02_08_05_world_2017_11_22_03_world.sql new file mode 100644 index 000000000..12d213ae2 --- /dev/null +++ b/sql/updates/world/master/2021_02_08_05_world_2017_11_22_03_world.sql @@ -0,0 +1,2 @@ +UPDATE `creature_template` SET `ScriptName` = 'npc_guard_generic' WHERE `ScriptName` = 'guard_generic'; +UPDATE `creature_template` SET `ScriptName` = 'npc_guard_shattrath_faction' WHERE `ScriptName` IN ('guard_shattrath_scryer', 'guard_shattrath_aldor');