mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-22 10:05:32 +01:00
Core/Movement: ported and merged Follow and Chase movement generator rewrite
This commit is contained in:
@@ -20,9 +20,11 @@
|
||||
#include "ArenaTeamMgr.h"
|
||||
#include "CellImpl.h"
|
||||
#include "CharacterCache.h"
|
||||
#include "ChaseMovementGenerator.h"
|
||||
#include "Chat.h"
|
||||
#include "DatabaseEnv.h"
|
||||
#include "DisableMgr.h"
|
||||
#include "FollowMovementGenerator.h"
|
||||
#include "GridNotifiers.h"
|
||||
#include "Group.h"
|
||||
#include "GroupMgr.h"
|
||||
@@ -45,7 +47,6 @@
|
||||
#include "SpellAuras.h"
|
||||
#include "SpellHistory.h"
|
||||
#include "SpellMgr.h"
|
||||
#include "TargetedMovementGenerator.h"
|
||||
#include "Transport.h"
|
||||
#include "Weather.h"
|
||||
#include "WeatherMgr.h"
|
||||
@@ -2153,11 +2154,7 @@ public:
|
||||
break;
|
||||
case CHASE_MOTION_TYPE:
|
||||
{
|
||||
Unit* target = nullptr;
|
||||
if (unit->GetTypeId() == TYPEID_PLAYER)
|
||||
target = static_cast<ChaseMovementGenerator<Player> const*>(movementGenerator)->GetTarget();
|
||||
else
|
||||
target = static_cast<ChaseMovementGenerator<Creature> const*>(movementGenerator)->GetTarget();
|
||||
Unit* target = static_cast<ChaseMovementGenerator const*>(movementGenerator)->GetTarget();
|
||||
|
||||
if (!target)
|
||||
handler->SendSysMessage(LANG_MOVEGENS_CHASE_NULL);
|
||||
@@ -2169,11 +2166,7 @@ public:
|
||||
}
|
||||
case FOLLOW_MOTION_TYPE:
|
||||
{
|
||||
Unit* target = nullptr;
|
||||
if (unit->GetTypeId() == TYPEID_PLAYER)
|
||||
target = static_cast<FollowMovementGenerator<Player> const*>(movementGenerator)->GetTarget();
|
||||
else
|
||||
target = static_cast<FollowMovementGenerator<Creature> const*>(movementGenerator)->GetTarget();
|
||||
Unit* target = static_cast<FollowMovementGenerator const*>(movementGenerator)->GetTarget();
|
||||
|
||||
if (!target)
|
||||
handler->SendSysMessage(LANG_MOVEGENS_FOLLOW_NULL);
|
||||
|
||||
@@ -36,7 +36,6 @@
|
||||
#include "Player.h"
|
||||
#include "PointMovementGenerator.h"
|
||||
#include "RBAC.h"
|
||||
#include "TargetedMovementGenerator.h"
|
||||
#include "WorldSession.h"
|
||||
|
||||
class mmaps_commandscript : public CommandScript
|
||||
|
||||
@@ -27,6 +27,7 @@ EndScriptData */
|
||||
#include "CreatureAI.h"
|
||||
#include "CreatureGroups.h"
|
||||
#include "DatabaseEnv.h"
|
||||
#include "FollowMovementGenerator.h"
|
||||
#include "Language.h"
|
||||
#include "Log.h"
|
||||
#include "Map.h"
|
||||
@@ -36,7 +37,6 @@ EndScriptData */
|
||||
#include "PhasingHandler.h"
|
||||
#include "Player.h"
|
||||
#include "RBAC.h"
|
||||
#include "TargetedMovementGenerator.h" // for HandleNpcUnFollowCommand
|
||||
#include "Transport.h"
|
||||
#include "World.h"
|
||||
#include "WorldSession.h"
|
||||
@@ -1349,7 +1349,7 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
FollowMovementGenerator<Creature> const* mgen = static_cast<FollowMovementGenerator<Creature> const*>((creature->GetMotionMaster()->top()));
|
||||
FollowMovementGenerator const* mgen = static_cast<FollowMovementGenerator const*>((creature->GetMotionMaster()->top()));
|
||||
|
||||
if (mgen->GetTarget() != player)
|
||||
{
|
||||
|
||||
@@ -536,7 +536,7 @@ public:
|
||||
if (ShadowBolt_Timer <= diff)
|
||||
{
|
||||
if (!me->IsWithinDist(me->GetVictim(), 45.0f))
|
||||
me->GetMotionMaster()->MoveChase(me->GetVictim(), VEKLOR_DIST, 0);
|
||||
me->GetMotionMaster()->MoveChase(me->GetVictim(), VEKLOR_DIST);
|
||||
else
|
||||
DoCastVictim(SPELL_SHADOWBOLT);
|
||||
ShadowBolt_Timer = 2000;
|
||||
@@ -586,7 +586,7 @@ public:
|
||||
// VL doesn't melee
|
||||
if (me->Attack(who, false))
|
||||
{
|
||||
me->GetMotionMaster()->MoveChase(who, VEKLOR_DIST, 0);
|
||||
me->GetMotionMaster()->MoveChase(who, VEKLOR_DIST);
|
||||
me->AddThreat(who, 0.0f);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user