diff --git a/src/game/AI/BaseAI/UnitAI.cpp b/src/game/AI/BaseAI/UnitAI.cpp index 8d179d2b03..528edb163c 100644 --- a/src/game/AI/BaseAI/UnitAI.cpp +++ b/src/game/AI/BaseAI/UnitAI.cpp @@ -18,6 +18,7 @@ #include "UnitAI.h" #include "Entities/Creature.h" +#include "Globals/SharedDefines.h" #include "Server/DBCStores.h" #include "Spells/Spell.h" #include "AI/ScriptDevAI/ScriptDevAIMgr.h" @@ -731,7 +732,7 @@ CreatureList UnitAI::DoFindFriendlyEligibleDispel(SpellEntry const* spellInfo, b dispelMask |= GetDispellMask(DispelType(spellInfo->EffectMiscValue[i])); else if (spellInfo->Effect[i] == SPELL_EFFECT_DISPEL_MECHANIC) mechanicMask |= (1 << (spellInfo->EffectMiscValue[i] - 1)); - } + } float maxRange = CalculateSpellRange(spellInfo); return DoFindFriendlyEligibleDispel(maxRange, dispelMask, mechanicMask, self); } @@ -972,6 +973,8 @@ void UnitAI::AddMainSpell(uint32 spellId) SpellEntry const* spellInfo = sSpellTemplate.LookupEntry(m_mainSpellId); m_mainSpellCost = Spell::CalculatePowerCost(spellInfo, m_unit); m_mainSpellMinRange = GetSpellMinRange(sSpellRangeStore.LookupEntry(spellInfo->rangeIndex)); + if (sSpellRangeStore.LookupEntry(spellInfo->rangeIndex)->Flags != static_cast(SpellRangeFlags::SPELL_RANGE_FLAG_MELEE)) + m_chaseDistance = GetSpellMaxRange(sSpellRangeStore.LookupEntry(spellInfo->rangeIndex)); m_mainAttackMask = SpellSchoolMask(m_mainAttackMask + spellInfo->SchoolMask); m_mainSpellInfo = spellInfo; } @@ -1148,6 +1151,9 @@ bool UnitAI::IsMainSpellPrevented(SpellEntry const* spellInfo) const if (spellInfo->PreventionType == SPELL_PREVENTION_TYPE_PACIFY && m_unit->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PACIFIED)) return true; + if (m_unit->GetPower(static_cast(spellInfo->powerType)) < m_mainSpellCost) + return true; + return false; } @@ -1376,4 +1382,3 @@ void UnitAI::AddInitialCooldowns() } } } - diff --git a/src/mangosd/mangosd.conf.dist.in b/src/mangosd/mangosd.conf.dist.in index 33576b38f8..e739ce4e0e 100644 --- a/src/mangosd/mangosd.conf.dist.in +++ b/src/mangosd/mangosd.conf.dist.in @@ -1,6 +1,6 @@ ##################################### -# MaNGOS Configuration file -# +# MaNGOS Configuration file +# # To overwrite configuration fields with environment variables # use the following pattern to generate environment variable names: # @@ -56,7 +56,7 @@ ConfVersion=2024020101 # Please, note, for data consistency only one connection for each database is used for transactions and async SELECTs. # So formula to find out how many connections will be established: X = #_connections + 1 # Default: 1 connection for SELECT statements -# +# # MaxPingTime # Settings for maximum database-ping interval (minutes between pings) # @@ -986,7 +986,7 @@ TalentsInspecting = 1 # # LeashRadius # Radius for default leash due to being too far from refresh position -# Default: 30 (yards) +# Default: 45 (yards) # # CreatureFamilyFleeAssistanceRadius # Radius which creature will use to seek for a near creature for assistance. Creature will flee to this creature. @@ -1096,7 +1096,7 @@ TalentsInspecting = 1 Rate.Creature.Aggro = 1 CreatureRespawnAggroDelay = 5000 -LeashRadius = 30 +LeashRadius = 45 CreatureFamilyFleeAssistanceRadius = 30 CreatureFamilyAssistanceRadius = 5 CreatureFamilyAssistanceDelay = 1500