diff --git a/src/server/game/AI/CreatureAI.cpp b/src/server/game/AI/CreatureAI.cpp index 4bf62fd3e4..74b761f910 100644 --- a/src/server/game/AI/CreatureAI.cpp +++ b/src/server/game/AI/CreatureAI.cpp @@ -390,19 +390,6 @@ void CreatureAI::SetBoundary(CreatureBoundary const* boundary, bool negateBounda me->DoImmediateBoundaryCheck(); } -void CreatureAI::CheckRepositionRequirements() -{ - if (Unit* victim = me->GetVictim()) - { - Position victimPos; - victimPos.Relocate(victim->GetPosition()); - - // If we are closer than 50% of the combat reach we are going to reposition ourself - if ((me->GetExactDist(victimPos) - me->GetCombatReach()) < CalculatePct(me->GetCombatReach(), 50)) - me->MoveAdvanceTo(victim); - } -} - Creature* CreatureAI::DoSummon(uint32 entry, const Position& pos, uint32 despawnTime, TempSummonType summonType) { return me->SummonCreature(entry, pos, summonType, despawnTime); diff --git a/src/server/game/AI/CreatureAI.h b/src/server/game/AI/CreatureAI.h index 8871bb010c..dc9483f762 100644 --- a/src/server/game/AI/CreatureAI.h +++ b/src/server/game/AI/CreatureAI.h @@ -206,9 +206,6 @@ class TC_GAME_API CreatureAI : public UnitAI static bool IsInBounds(CreatureBoundary const& boundary, Position const* who); - // Called every 3 Seconds to check if the creature needs to reposition itself - void CheckRepositionRequirements(); - protected: virtual void MoveInLineOfSight(Unit* /*who*/); diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp index d674e816a2..d2e340c25a 100644 --- a/src/server/game/Entities/Creature/Creature.cpp +++ b/src/server/game/Entities/Creature/Creature.cpp @@ -182,7 +182,7 @@ bool ForcedDespawnDelayEvent::Execute(uint64 /*e_time*/, uint32 /*p_time*/) Creature::Creature(bool isWorldObject): Unit(isWorldObject), MapObject(), m_groupLootTimer(0), lootingGroupLowGUID(0), m_PlayerDamageReq(0), m_lootRecipient(), m_lootRecipientGroup(0), _skinner(), _pickpocketLootRestore(0), m_corpseRemoveTime(0), m_respawnTime(0), -m_respawnDelay(300), m_corpseDelay(60), m_respawnradius(0.0f), m_boundaryCheckTime(2500), m_combatPulseTime(0), m_combatPulseDelay(0), m_advanceMovementTime(3000), m_reactState(REACT_AGGRESSIVE), +m_respawnDelay(300), m_corpseDelay(60), m_respawnradius(0.0f), m_boundaryCheckTime(2500), m_combatPulseTime(0), m_combatPulseDelay(0), m_reactState(REACT_AGGRESSIVE), m_defaultMovementType(IDLE_MOTION_TYPE), m_spawnId(0), m_equipmentId(0), m_originalEquipmentId(0), m_AlreadyCallAssistance(false), m_AlreadySearchedAssistance(false), m_regenHealth(true), m_cannotReachTarget(false), m_cannotReachTimer(0), m_AI_locked(false), m_meleeDamageSchoolMask(SPELL_SCHOOL_MASK_NORMAL), m_originalEntry(0), m_homePosition(), m_transportHomePosition(), m_creatureInfo(nullptr), m_creatureData(nullptr), m_waypointID(0), m_path_id(0), m_formation(nullptr), m_focusSpell(nullptr), m_focusDelay(0), m_shouldReacquireTarget(false), m_suppressedOrientation(0.0f) @@ -619,8 +619,7 @@ void Creature::Update(uint32 diff) LastCharmerGUID.Clear(); } - // periodic check to see if the creature has passed an evade boundary... - // or if the creature needs to reposition itself + // periodic check to see if the creature has passed an evade boundary if (IsAIEnabled && !IsInEvadeMode() && IsInCombat()) { if (diff >= m_boundaryCheckTime) @@ -629,15 +628,6 @@ void Creature::Update(uint32 diff) m_boundaryCheckTime = 2500; } else m_boundaryCheckTime -= diff; - - if (diff >= m_advanceMovementTime) - { - // AI()->CheckRepositionRequirements(); - m_advanceMovementTime = 3000; - } - else - m_advanceMovementTime -= diff; - } // if periodic combat pulse is enabled and we are both in combat and in a dungeon, do this now diff --git a/src/server/game/Entities/Creature/Creature.h b/src/server/game/Entities/Creature/Creature.h index 9a3dfe8e34..32cf1c234d 100644 --- a/src/server/game/Entities/Creature/Creature.h +++ b/src/server/game/Entities/Creature/Creature.h @@ -757,7 +757,6 @@ class TC_GAME_API Creature : public Unit, public GridObject, public Ma uint32 m_boundaryCheckTime; // (msecs) remaining time for next evade boundary check uint32 m_combatPulseTime; // (msecs) remaining time for next zone-in-combat pulse uint32 m_combatPulseDelay; // (secs) how often the creature puts the entire zone in combat (only works in dungeons) - uint32 m_advanceMovementTime; // (msecs) remaining time for next reposition update to avoid creatures standing inside each other ReactStates m_reactState; // for AI, not charmInfo void RegenerateMana(); diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index b5e8f3143b..cb0d0e43a8 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -485,28 +485,6 @@ void Unit::MonsterMoveWithSpeed(float x, float y, float z, float speed, bool gen init.Launch(); } -void Unit::MoveAdvanceTo(Unit* target) -{ - if (!target) // Just in case - return; - - // Do not reposition ourself when we are not allowed to move - if ((IsMovementPreventedByCasting() || isMoving() || !CanFreeMove()) && - GetMotionMaster()->GetCurrentMovementGeneratorType() != CHASE_MOTION_TYPE) - return; - - float x, y, z; - GetNearPoint(target, x, y, z, 0.0f, 0.0f, target->GetAngle(this)); - Movement::MoveSplineInit init(this); - init.MoveTo(x, y, z, true, false); - - // Creatures except humanoids move backwards instead of turning arround - if (ToCreature() && ToCreature()->GetCreatureTemplate()->type != CREATURE_TYPE_HUMANOID) - init.SetOrientationFixed(true); - - init.Launch(); -} - void Unit::UpdateSplineMovement(uint32 t_diff) { if (movespline->Finalized()) diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index 90a2c74881..83a92a0b71 100644 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -1649,7 +1649,6 @@ class TC_GAME_API Unit : public WorldObject void JumpTo(WorldObject* obj, float speedZ, bool withOrientation = false); void MonsterMoveWithSpeed(float x, float y, float z, float speed, bool generatePath = false, bool forceDestination = false); - void MoveAdvanceTo(Unit* target); void SendSetPlayHoverAnim(bool enable); void SendMovementSetSplineAnim(Movement::AnimType anim);