Core/Movement: MotionMaster reimplementation (#21888)
Internal structure and handling changes, nothing behavioural (or thats the intention at least). (cherry picked from commit 982643cd96790ffc54e7a3e507469649f3b074d2)
This commit is contained in:
@@ -27,7 +27,6 @@ EndScriptData */
|
||||
#include "DatabaseEnv.h"
|
||||
#include "Language.h"
|
||||
#include "MapManager.h"
|
||||
#include "MotionMaster.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "PhasingHandler.h"
|
||||
#include "Player.h"
|
||||
@@ -152,13 +151,9 @@ public:
|
||||
|
||||
// stop flight if need
|
||||
if (player->IsInFlight())
|
||||
{
|
||||
player->GetMotionMaster()->MovementExpired();
|
||||
player->CleanupAfterTaxiFlight();
|
||||
}
|
||||
// save only in non-flight case
|
||||
player->FinishTaxiFlight();
|
||||
else
|
||||
player->SaveRecallPosition();
|
||||
player->SaveRecallPosition(); // save only in non-flight case
|
||||
|
||||
player->TeleportTo(mapId, x, y, z, o);
|
||||
return true;
|
||||
@@ -197,13 +192,9 @@ public:
|
||||
|
||||
// stop flight if need
|
||||
if (player->IsInFlight())
|
||||
{
|
||||
player->GetMotionMaster()->MovementExpired();
|
||||
player->CleanupAfterTaxiFlight();
|
||||
}
|
||||
// save only in non-flight case
|
||||
player->FinishTaxiFlight();
|
||||
else
|
||||
player->SaveRecallPosition();
|
||||
player->SaveRecallPosition(); // save only in non-flight case
|
||||
|
||||
player->TeleportTo(gy->Loc);
|
||||
return true;
|
||||
@@ -239,13 +230,9 @@ public:
|
||||
|
||||
// stop flight if need
|
||||
if (player->IsInFlight())
|
||||
{
|
||||
player->GetMotionMaster()->MovementExpired();
|
||||
player->CleanupAfterTaxiFlight();
|
||||
}
|
||||
// save only in non-flight case
|
||||
player->FinishTaxiFlight();
|
||||
else
|
||||
player->SaveRecallPosition();
|
||||
player->SaveRecallPosition(); // save only in non-flight case
|
||||
|
||||
Map* map = sMapMgr->CreateBaseMap(mapId);
|
||||
float z = std::max(map->GetStaticHeight(PhasingHandler::GetEmptyPhaseShift(), x, y, MAX_HEIGHT), map->GetWaterLevel(PhasingHandler::GetEmptyPhaseShift(), x, y));
|
||||
@@ -289,13 +276,9 @@ public:
|
||||
|
||||
// stop flight if need
|
||||
if (player->IsInFlight())
|
||||
{
|
||||
player->GetMotionMaster()->MovementExpired();
|
||||
player->CleanupAfterTaxiFlight();
|
||||
}
|
||||
// save only in non-flight case
|
||||
player->FinishTaxiFlight();
|
||||
else
|
||||
player->SaveRecallPosition();
|
||||
player->SaveRecallPosition(); // save only in non-flight case
|
||||
|
||||
player->TeleportTo(goData->spawnPoint);
|
||||
return true;
|
||||
@@ -352,13 +335,9 @@ public:
|
||||
|
||||
// stop flight if need
|
||||
if (player->IsInFlight())
|
||||
{
|
||||
player->GetMotionMaster()->MovementExpired();
|
||||
player->CleanupAfterTaxiFlight();
|
||||
}
|
||||
// save only in non-flight case
|
||||
player->FinishTaxiFlight();
|
||||
else
|
||||
player->SaveRecallPosition();
|
||||
player->SaveRecallPosition(); // save only in non-flight case
|
||||
|
||||
Map* map = sMapMgr->CreateBaseMap(mapId);
|
||||
z = std::max(map->GetStaticHeight(PhasingHandler::GetEmptyPhaseShift(), x, y, MAX_HEIGHT), map->GetWaterLevel(PhasingHandler::GetEmptyPhaseShift(), x, y));
|
||||
@@ -400,13 +379,9 @@ public:
|
||||
|
||||
// stop flight if need
|
||||
if (player->IsInFlight())
|
||||
{
|
||||
player->GetMotionMaster()->MovementExpired();
|
||||
player->CleanupAfterTaxiFlight();
|
||||
}
|
||||
// save only in non-flight case
|
||||
player->FinishTaxiFlight();
|
||||
else
|
||||
player->SaveRecallPosition();
|
||||
player->SaveRecallPosition(); // save only in non-flight case
|
||||
|
||||
player->TeleportTo(node->ContinentID, node->Pos.X, node->Pos.Y, node->Pos.Z, player->GetOrientation());
|
||||
return true;
|
||||
@@ -445,13 +420,9 @@ public:
|
||||
|
||||
// stop flight if need
|
||||
if (player->IsInFlight())
|
||||
{
|
||||
player->GetMotionMaster()->MovementExpired();
|
||||
player->CleanupAfterTaxiFlight();
|
||||
}
|
||||
// save only in non-flight case
|
||||
player->FinishTaxiFlight();
|
||||
else
|
||||
player->SaveRecallPosition();
|
||||
player->SaveRecallPosition(); // save only in non-flight case
|
||||
|
||||
player->TeleportTo(at->ContinentID, at->Pos.X, at->Pos.Y, at->Pos.Z, player->GetOrientation());
|
||||
return true;
|
||||
@@ -519,13 +490,9 @@ public:
|
||||
|
||||
// stop flight if need
|
||||
if (player->IsInFlight())
|
||||
{
|
||||
player->GetMotionMaster()->MovementExpired();
|
||||
player->CleanupAfterTaxiFlight();
|
||||
}
|
||||
// save only in non-flight case
|
||||
player->FinishTaxiFlight();
|
||||
else
|
||||
player->SaveRecallPosition();
|
||||
player->SaveRecallPosition(); // save only in non-flight case
|
||||
|
||||
float z = std::max(map->GetStaticHeight(PhasingHandler::GetEmptyPhaseShift(), x, y, MAX_HEIGHT), map->GetWaterLevel(PhasingHandler::GetEmptyPhaseShift(), x, y));
|
||||
|
||||
@@ -580,13 +547,9 @@ public:
|
||||
|
||||
// stop flight if need
|
||||
if (player->IsInFlight())
|
||||
{
|
||||
player->GetMotionMaster()->MovementExpired();
|
||||
player->CleanupAfterTaxiFlight();
|
||||
}
|
||||
// save only in non-flight case
|
||||
player->FinishTaxiFlight();
|
||||
else
|
||||
player->SaveRecallPosition();
|
||||
player->SaveRecallPosition(); // save only in non-flight case
|
||||
|
||||
player->TeleportTo(mapId, x, y, z, ort);
|
||||
return true;
|
||||
@@ -614,13 +577,12 @@ public:
|
||||
}
|
||||
|
||||
Player* player = handler->GetSession()->GetPlayer();
|
||||
|
||||
// stop flight if need
|
||||
if (player->IsInFlight())
|
||||
{
|
||||
player->GetMotionMaster()->MovementExpired();
|
||||
player->CleanupAfterTaxiFlight();
|
||||
}
|
||||
player->FinishTaxiFlight();
|
||||
else
|
||||
player->SaveRecallPosition();
|
||||
player->SaveRecallPosition(); // save only in non-flight case
|
||||
|
||||
ticket->TeleportTo(player);
|
||||
return true;
|
||||
@@ -658,13 +620,9 @@ public:
|
||||
|
||||
// stop flight if need
|
||||
if (player->IsInFlight())
|
||||
{
|
||||
player->GetMotionMaster()->MovementExpired();
|
||||
player->CleanupAfterTaxiFlight();
|
||||
}
|
||||
// save only in non-flight case
|
||||
player->FinishTaxiFlight();
|
||||
else
|
||||
player->SaveRecallPosition();
|
||||
player->SaveRecallPosition(); // save only in non-flight case
|
||||
|
||||
player->TeleportTo(player->GetMapId(), x, y, z, o);
|
||||
return true;
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
#include "Language.h"
|
||||
#include "LFG.h"
|
||||
#include "Map.h"
|
||||
#include "MotionMaster.h"
|
||||
#include "ObjectAccessor.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "PhasingHandler.h"
|
||||
@@ -144,13 +143,9 @@ public:
|
||||
|
||||
// stop flight if need
|
||||
if (player->IsInFlight())
|
||||
{
|
||||
player->GetMotionMaster()->MovementExpired();
|
||||
player->CleanupAfterTaxiFlight();
|
||||
}
|
||||
// save only in non-flight case
|
||||
player->FinishTaxiFlight();
|
||||
else
|
||||
player->SaveRecallPosition();
|
||||
player->SaveRecallPosition(); // save only in non-flight case
|
||||
|
||||
// before GM
|
||||
float x, y, z;
|
||||
|
||||
@@ -20,12 +20,10 @@
|
||||
#include "ArenaTeamMgr.h"
|
||||
#include "CellImpl.h"
|
||||
#include "CharacterCache.h"
|
||||
#include "ChaseMovementGenerator.h"
|
||||
#include "Chat.h"
|
||||
#include "DatabaseEnv.h"
|
||||
#include "DB2Stores.h"
|
||||
#include "DisableMgr.h"
|
||||
#include "FollowMovementGenerator.h"
|
||||
#include "GridNotifiers.h"
|
||||
#include "Group.h"
|
||||
#include "GroupMgr.h"
|
||||
@@ -41,7 +39,6 @@
|
||||
#include "MMapFactory.h"
|
||||
#include "MotionMaster.h"
|
||||
#include "MovementDefines.h"
|
||||
#include "MovementGenerator.h"
|
||||
#include "ObjectAccessor.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "Opcodes.h"
|
||||
@@ -459,13 +456,9 @@ public:
|
||||
|
||||
// stop flight if need
|
||||
if (_player->IsInFlight())
|
||||
{
|
||||
_player->GetMotionMaster()->MovementExpired();
|
||||
_player->CleanupAfterTaxiFlight();
|
||||
}
|
||||
// save only in non-flight case
|
||||
_player->FinishTaxiFlight();
|
||||
else
|
||||
_player->SaveRecallPosition();
|
||||
_player->SaveRecallPosition(); // save only in non-flight case
|
||||
|
||||
// to point to see at target with same orientation
|
||||
float x, y, z;
|
||||
@@ -494,13 +487,9 @@ public:
|
||||
|
||||
// stop flight if need
|
||||
if (_player->IsInFlight())
|
||||
{
|
||||
_player->GetMotionMaster()->MovementExpired();
|
||||
_player->CleanupAfterTaxiFlight();
|
||||
}
|
||||
// save only in non-flight case
|
||||
_player->FinishTaxiFlight();
|
||||
else
|
||||
_player->SaveRecallPosition();
|
||||
_player->SaveRecallPosition(); // save only in non-flight case
|
||||
|
||||
_player->TeleportTo(map, x, y, z, _player->GetOrientation());
|
||||
}
|
||||
@@ -590,14 +579,10 @@ public:
|
||||
ChatHandler(target->GetSession()).PSendSysMessage(LANG_SUMMONED_BY, handler->playerLink(_player->GetName()).c_str());
|
||||
|
||||
// stop flight if need
|
||||
if (target->IsInFlight())
|
||||
{
|
||||
target->GetMotionMaster()->MovementExpired();
|
||||
target->CleanupAfterTaxiFlight();
|
||||
}
|
||||
// save only in non-flight case
|
||||
if (_player->IsInFlight())
|
||||
_player->FinishTaxiFlight();
|
||||
else
|
||||
target->SaveRecallPosition();
|
||||
_player->SaveRecallPosition(); // save only in non-flight case
|
||||
|
||||
// before GM
|
||||
float x, y, z;
|
||||
@@ -899,12 +884,7 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
// stop flight if need
|
||||
if (target->IsInFlight())
|
||||
{
|
||||
target->GetMotionMaster()->MovementExpired();
|
||||
target->CleanupAfterTaxiFlight();
|
||||
}
|
||||
target->FinishTaxiFlight();
|
||||
|
||||
target->Recall();
|
||||
return true;
|
||||
@@ -2210,20 +2190,19 @@ public:
|
||||
|
||||
handler->PSendSysMessage(LANG_MOVEGENS_LIST, (unit->GetTypeId() == TYPEID_PLAYER ? "Player" : "Creature"), unit->GetGUID().ToString().c_str());
|
||||
|
||||
MotionMaster* motionMaster = unit->GetMotionMaster();
|
||||
float x, y, z;
|
||||
motionMaster->GetDestination(x, y, z);
|
||||
|
||||
for (uint8 itr = 0; itr < MAX_MOTION_SLOT; ++itr)
|
||||
if (unit->GetMotionMaster()->Empty())
|
||||
{
|
||||
MovementGenerator* movementGenerator = motionMaster->GetMotionSlot(MovementSlot(itr));
|
||||
if (!movementGenerator)
|
||||
{
|
||||
handler->SendSysMessage("Empty");
|
||||
continue;
|
||||
}
|
||||
handler->SendSysMessage("Empty");
|
||||
return true;
|
||||
}
|
||||
|
||||
switch (movementGenerator->GetMovementGeneratorType())
|
||||
float x, y, z;
|
||||
unit->GetMotionMaster()->GetDestination(x, y, z);
|
||||
|
||||
std::vector<MovementGeneratorInformation> list = unit->GetMotionMaster()->GetMovementGeneratorsInformation();
|
||||
for (MovementGeneratorInformation info : list)
|
||||
{
|
||||
switch (info.Type)
|
||||
{
|
||||
case IDLE_MOTION_TYPE:
|
||||
handler->SendSysMessage(LANG_MOVEGENS_IDLE);
|
||||
@@ -2238,45 +2217,33 @@ public:
|
||||
handler->SendSysMessage(LANG_MOVEGENS_CONFUSED);
|
||||
break;
|
||||
case CHASE_MOTION_TYPE:
|
||||
{
|
||||
Unit* target = static_cast<ChaseMovementGenerator const*>(movementGenerator)->GetTarget();
|
||||
|
||||
if (!target)
|
||||
if (info.TargetGUID.IsEmpty())
|
||||
handler->SendSysMessage(LANG_MOVEGENS_CHASE_NULL);
|
||||
else if (target->GetTypeId() == TYPEID_PLAYER)
|
||||
handler->PSendSysMessage(LANG_MOVEGENS_CHASE_PLAYER, target->GetName().c_str(), target->GetGUID().ToString().c_str());
|
||||
else if (info.TargetGUID.IsPlayer())
|
||||
handler->PSendSysMessage(LANG_MOVEGENS_CHASE_PLAYER, info.TargetName.c_str(), info.TargetGUID.ToString().c_str());
|
||||
else
|
||||
handler->PSendSysMessage(LANG_MOVEGENS_CHASE_CREATURE, target->GetName().c_str(), target->GetGUID().ToString().c_str());
|
||||
handler->PSendSysMessage(LANG_MOVEGENS_CHASE_CREATURE, info.TargetName.c_str(), info.TargetGUID.ToString().c_str());
|
||||
break;
|
||||
}
|
||||
case FOLLOW_MOTION_TYPE:
|
||||
{
|
||||
Unit* target = static_cast<FollowMovementGenerator const*>(movementGenerator)->GetTarget();
|
||||
|
||||
if (!target)
|
||||
if (info.TargetGUID.IsEmpty())
|
||||
handler->SendSysMessage(LANG_MOVEGENS_FOLLOW_NULL);
|
||||
else if (target->GetTypeId() == TYPEID_PLAYER)
|
||||
handler->PSendSysMessage(LANG_MOVEGENS_FOLLOW_PLAYER, target->GetName().c_str(), target->GetGUID().ToString().c_str());
|
||||
else if (info.TargetGUID.IsPlayer())
|
||||
handler->PSendSysMessage(LANG_MOVEGENS_FOLLOW_PLAYER, info.TargetName.c_str(), info.TargetGUID.ToString().c_str());
|
||||
else
|
||||
handler->PSendSysMessage(LANG_MOVEGENS_FOLLOW_CREATURE, target->GetName().c_str(), target->GetGUID().ToString().c_str());
|
||||
handler->PSendSysMessage(LANG_MOVEGENS_FOLLOW_CREATURE, info.TargetName.c_str(), info.TargetGUID.ToString().c_str());
|
||||
break;
|
||||
}
|
||||
case HOME_MOTION_TYPE:
|
||||
{
|
||||
if (unit->GetTypeId() == TYPEID_UNIT)
|
||||
handler->PSendSysMessage(LANG_MOVEGENS_HOME_CREATURE, x, y, z);
|
||||
else
|
||||
handler->SendSysMessage(LANG_MOVEGENS_HOME_PLAYER);
|
||||
break;
|
||||
}
|
||||
case FLIGHT_MOTION_TYPE:
|
||||
handler->SendSysMessage(LANG_MOVEGENS_FLIGHT);
|
||||
break;
|
||||
case POINT_MOTION_TYPE:
|
||||
{
|
||||
handler->PSendSysMessage(LANG_MOVEGENS_POINT, x, y, z);
|
||||
break;
|
||||
}
|
||||
case FLEEING_MOTION_TYPE:
|
||||
handler->SendSysMessage(LANG_MOVEGENS_FEAR);
|
||||
break;
|
||||
@@ -2287,7 +2254,7 @@ public:
|
||||
handler->SendSysMessage(LANG_MOVEGENS_EFFECT);
|
||||
break;
|
||||
default:
|
||||
handler->PSendSysMessage(LANG_MOVEGENS_UNKNOWN, movementGenerator->GetMovementGeneratorType());
|
||||
handler->PSendSysMessage(LANG_MOVEGENS_UNKNOWN, info.Type);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1370,7 +1370,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
//npc unfollow handling
|
||||
// npc unfollow handling
|
||||
static bool HandleNpcUnFollowCommand(ChatHandler* handler, char const* /*args*/)
|
||||
{
|
||||
Player* player = handler->GetSession()->GetPlayer();
|
||||
@@ -1383,26 +1383,24 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
if (/*creature->GetMotionMaster()->empty() ||*/
|
||||
creature->GetMotionMaster()->GetCurrentMovementGeneratorType() != FOLLOW_MOTION_TYPE)
|
||||
MovementGenerator* movement = creature->GetMotionMaster()->GetMovementGenerator([player](MovementGenerator const* a) -> bool
|
||||
{
|
||||
if (a->GetMovementGeneratorType() == FOLLOW_MOTION_TYPE)
|
||||
{
|
||||
FollowMovementGenerator const* followMovement = dynamic_cast<FollowMovementGenerator const*>(a);
|
||||
return followMovement && followMovement->GetTarget() == player;
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
if (!movement)
|
||||
{
|
||||
handler->PSendSysMessage(LANG_CREATURE_NOT_FOLLOW_YOU, creature->GetName().c_str());
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
|
||||
FollowMovementGenerator const* mgen = static_cast<FollowMovementGenerator const*>((creature->GetMotionMaster()->top()));
|
||||
|
||||
if (mgen->GetTarget() != player)
|
||||
{
|
||||
handler->PSendSysMessage(LANG_CREATURE_NOT_FOLLOW_YOU, creature->GetName().c_str());
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
|
||||
// reset movement
|
||||
creature->GetMotionMaster()->MovementExpired(true);
|
||||
|
||||
creature->GetMotionMaster()->Remove(movement);
|
||||
handler->PSendSysMessage(LANG_CREATURE_NOT_FOLLOW_YOU_NOW, creature->GetName().c_str());
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -29,7 +29,6 @@ EndScriptData */
|
||||
#include "Group.h"
|
||||
#include "Language.h"
|
||||
#include "MapManager.h"
|
||||
#include "MotionMaster.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "PhasingHandler.h"
|
||||
#include "Player.h"
|
||||
@@ -186,13 +185,9 @@ public:
|
||||
|
||||
// stop flight if need
|
||||
if (target->IsInFlight())
|
||||
{
|
||||
target->GetMotionMaster()->MovementExpired();
|
||||
target->CleanupAfterTaxiFlight();
|
||||
}
|
||||
// save only in non-flight case
|
||||
target->FinishTaxiFlight();
|
||||
else
|
||||
target->SaveRecallPosition();
|
||||
target->SaveRecallPosition(); // save only in non-flight case
|
||||
|
||||
target->TeleportTo(tele->mapId, tele->position_x, tele->position_y, tele->position_z, tele->orientation);
|
||||
}
|
||||
@@ -284,13 +279,9 @@ public:
|
||||
|
||||
// stop flight if need
|
||||
if (player->IsInFlight())
|
||||
{
|
||||
player->GetMotionMaster()->MovementExpired();
|
||||
player->CleanupAfterTaxiFlight();
|
||||
}
|
||||
// save only in non-flight case
|
||||
player->FinishTaxiFlight();
|
||||
else
|
||||
player->SaveRecallPosition();
|
||||
player->SaveRecallPosition(); // save only in non-flight case
|
||||
|
||||
player->TeleportTo(tele->mapId, tele->position_x, tele->position_y, tele->position_z, tele->orientation);
|
||||
}
|
||||
@@ -303,7 +294,7 @@ public:
|
||||
if (!*args)
|
||||
return false;
|
||||
|
||||
Player* me = handler->GetSession()->GetPlayer();
|
||||
Player* player = handler->GetSession()->GetPlayer();
|
||||
|
||||
// id, or string, or [name] Shift-click form |color|Htele:id|h[name]|h|r
|
||||
GameTele const* tele = handler->extractGameTeleFromLink((char*)args);
|
||||
@@ -314,7 +305,7 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
if (me->IsInCombat() && !handler->GetSession()->HasPermission(rbac::RBAC_PERM_COMMAND_TELE_NAME))
|
||||
if (player->IsInCombat() && !handler->GetSession()->HasPermission(rbac::RBAC_PERM_COMMAND_TELE_NAME))
|
||||
{
|
||||
handler->SendSysMessage(LANG_YOU_IN_COMBAT);
|
||||
handler->SetSentErrorMessage(true);
|
||||
@@ -322,7 +313,7 @@ public:
|
||||
}
|
||||
|
||||
MapEntry const* map = sMapStore.LookupEntry(tele->mapId);
|
||||
if (!map || (map->IsBattlegroundOrArena() && (me->GetMapId() != tele->mapId || !me->IsGameMaster())))
|
||||
if (!map || (map->IsBattlegroundOrArena() && (player->GetMapId() != tele->mapId || !player->IsGameMaster())))
|
||||
{
|
||||
handler->SendSysMessage(LANG_CANNOT_TELE_TO_BG);
|
||||
handler->SetSentErrorMessage(true);
|
||||
@@ -330,16 +321,12 @@ public:
|
||||
}
|
||||
|
||||
// stop flight if need
|
||||
if (me->IsInFlight())
|
||||
{
|
||||
me->GetMotionMaster()->MovementExpired();
|
||||
me->CleanupAfterTaxiFlight();
|
||||
}
|
||||
// save only in non-flight case
|
||||
if (player->IsInFlight())
|
||||
player->FinishTaxiFlight();
|
||||
else
|
||||
me->SaveRecallPosition();
|
||||
player->SaveRecallPosition(); // save only in non-flight case
|
||||
|
||||
me->TeleportTo(tele->mapId, tele->position_x, tele->position_y, tele->position_z, tele->orientation);
|
||||
player->TeleportTo(tele->mapId, tele->position_x, tele->position_y, tele->position_z, tele->orientation);
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -538,7 +538,7 @@ public:
|
||||
Talk(SAY_ATIESH);
|
||||
me->SetFacingTo(me->GetAbsoluteAngle(player));
|
||||
me->ClearUnitState(UNIT_STATE_MOVING);
|
||||
me->GetMotionMaster()->MoveDistract(7 * IN_MILLISECONDS);
|
||||
me->GetMotionMaster()->MoveDistract(7 * IN_MILLISECONDS, me->GetAbsoluteAngle(who));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1021,7 +1021,7 @@ void PretendToDie(Creature* creature)
|
||||
creature->RemoveAllAuras();
|
||||
creature->SetHealth(0);
|
||||
creature->AddUnitFlag(UNIT_FLAG_NOT_SELECTABLE);
|
||||
creature->GetMotionMaster()->MovementExpired(false);
|
||||
creature->GetMotionMaster()->Clear();
|
||||
creature->GetMotionMaster()->MoveIdle();
|
||||
creature->SetStandState(UNIT_STAND_STATE_DEAD);
|
||||
}
|
||||
|
||||
@@ -391,7 +391,7 @@ class npc_eye_of_acherus : public CreatureScript
|
||||
Movement::MoveSplineInit init(me);
|
||||
init.MoveTo(EyeOFAcherusFallPoint.GetPositionX(), EyeOFAcherusFallPoint.GetPositionY(), EyeOFAcherusFallPoint.GetPositionZ(), false);
|
||||
init.SetFall();
|
||||
me->GetMotionMaster()->LaunchMoveSpline(std::move(init), POINT_EYE_FALL, MOTION_SLOT_ACTIVE, POINT_MOTION_TYPE);
|
||||
me->GetMotionMaster()->LaunchMoveSpline(std::move(init), POINT_EYE_FALL, MOTION_PRIORITY_NORMAL, POINT_MOTION_TYPE);
|
||||
}
|
||||
|
||||
void OnCharmed(bool /*apply*/) override { }
|
||||
|
||||
@@ -78,7 +78,7 @@ public:
|
||||
z += 4.0f;
|
||||
x -= 3.5f;
|
||||
y -= 5.0f;
|
||||
me->GetMotionMaster()->Clear(false);
|
||||
me->GetMotionMaster()->Clear();
|
||||
me->UpdatePosition(x, y, z, 0.0f);
|
||||
}
|
||||
|
||||
|
||||
@@ -322,7 +322,7 @@ public:
|
||||
DoCast(me, SPELL_HEAD_LANDS, true);
|
||||
DoCast(me, SPELL_HEAD, false);
|
||||
SaySound(SAY_LOST_HEAD);
|
||||
me->GetMotionMaster()->Clear(false);
|
||||
me->GetMotionMaster()->Clear();
|
||||
me->GetMotionMaster()->MoveFleeing(caster->GetVictim());
|
||||
}
|
||||
}
|
||||
@@ -337,7 +337,7 @@ public:
|
||||
wait = 1000;
|
||||
if (!me->GetVictim())
|
||||
return;
|
||||
me->GetMotionMaster()->Clear(false);
|
||||
me->GetMotionMaster()->Clear();
|
||||
me->GetMotionMaster()->MoveFleeing(me->GetVictim());
|
||||
}
|
||||
else wait -= diff;
|
||||
@@ -602,7 +602,7 @@ public:
|
||||
me->SetFullHealth();
|
||||
SaySound(SAY_REJOINED);
|
||||
DoCast(me, SPELL_HEAD);
|
||||
caster->GetMotionMaster()->Clear(false);
|
||||
caster->GetMotionMaster()->Clear();
|
||||
caster->GetMotionMaster()->MoveFollow(me, 6, float(urand(0, 5)));
|
||||
}
|
||||
}
|
||||
@@ -677,7 +677,7 @@ public:
|
||||
if (wp_reached)
|
||||
{
|
||||
wp_reached = false;
|
||||
me->GetMotionMaster()->Clear(false);
|
||||
me->GetMotionMaster()->Clear();
|
||||
me->GetMotionMaster()->MovePoint(id, FlightPoint[id]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -128,19 +128,19 @@ public:
|
||||
Talk(SAY_MO_KILL);
|
||||
}
|
||||
|
||||
void DamageTaken(Unit* /*doneBy*/, uint32 &damage) override
|
||||
void DamageTaken(Unit* /*doneBy*/, uint32& damage) override
|
||||
{
|
||||
if (damage < me->GetHealth() || _bHasDied || _bFakeDeath)
|
||||
if (damage <= me->GetHealth() || _bHasDied || _bFakeDeath)
|
||||
return;
|
||||
|
||||
//On first death, fake death and open door, as well as initiate whitemane if exist
|
||||
// On first death, fake death and open door, as well as initiate whitemane if exist
|
||||
if (Unit* Whitemane = ObjectAccessor::GetUnit(*me, instance->GetGuidData(DATA_WHITEMANE)))
|
||||
{
|
||||
instance->SetBossState(DATA_MOGRAINE_AND_WHITE_EVENT, IN_PROGRESS);
|
||||
|
||||
Whitemane->GetMotionMaster()->MovePoint(1, 1163.113370f, 1398.856812f, 32.527786f);
|
||||
|
||||
me->GetMotionMaster()->MovementExpired();
|
||||
me->GetMotionMaster()->Clear();
|
||||
me->GetMotionMaster()->MoveIdle();
|
||||
|
||||
me->SetHealth(0);
|
||||
|
||||
@@ -277,7 +277,7 @@ public:
|
||||
{
|
||||
case 0:
|
||||
//me->AttackStop();
|
||||
me->GetMotionMaster()->Clear(false);
|
||||
me->GetMotionMaster()->Clear();
|
||||
me->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF);
|
||||
me->StopMoving();
|
||||
Talk(YELL_TAKEOFF);
|
||||
|
||||
@@ -407,7 +407,7 @@ public:
|
||||
|
||||
if (!HasProtected)
|
||||
{
|
||||
me->GetMotionMaster()->Clear(false);
|
||||
me->GetMotionMaster()->Clear();
|
||||
me->GetMotionMaster()->MoveIdle();
|
||||
|
||||
// All members of raid must get this buff
|
||||
@@ -494,7 +494,7 @@ public:
|
||||
switch (actionId)
|
||||
{
|
||||
case ACTION_ENRAGE:
|
||||
me->GetMotionMaster()->Clear(false);
|
||||
me->GetMotionMaster()->Clear();
|
||||
me->GetMotionMaster()->MoveIdle();
|
||||
Enraged = true;
|
||||
Talk(SAY_ENRAGE);
|
||||
|
||||
@@ -367,7 +367,7 @@ class npc_molten_barrage : public CreatureScript
|
||||
void AttackStart(Unit* target) override
|
||||
{
|
||||
if (target)
|
||||
me->GetMotionMaster()->MoveFollow(target, 0.0f, 0.0f, MOTION_SLOT_IDLE);
|
||||
me->GetMotionMaster()->MoveFollow(target, 0.0f, 0.0f, MOTION_SLOT_DEFAULT);
|
||||
}
|
||||
|
||||
void IsSummonedBy(Unit* /*summoner*/) override
|
||||
|
||||
@@ -79,7 +79,7 @@ void firelands_bossAI::EnterEvadeMode(EvadeReason why)
|
||||
{
|
||||
if (Unit* owner = me->GetCharmerOrOwner())
|
||||
{
|
||||
me->GetMotionMaster()->Clear(false);
|
||||
me->GetMotionMaster()->Clear();
|
||||
me->GetMotionMaster()->MoveFollow(owner, PET_FOLLOW_DIST, me->GetFollowAngle(), MOTION_SLOT_ACTIVE);
|
||||
}
|
||||
else
|
||||
|
||||
+1
-1
@@ -824,7 +824,7 @@ class npc_anubarak_spike : public CreatureScript
|
||||
me->GetThreatManager().ResetAllThreat();
|
||||
DoZoneInCombat();
|
||||
AddThreat(who, 1000000.0f);
|
||||
me->GetMotionMaster()->Clear(true);
|
||||
me->GetMotionMaster()->Clear();
|
||||
me->GetMotionMaster()->MoveChase(who);
|
||||
}
|
||||
|
||||
|
||||
+37
-17
@@ -15,20 +15,24 @@
|
||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "halls_of_reflection.h"
|
||||
#include "Creature.h"
|
||||
#include "EventProcessor.h"
|
||||
#include "InstanceScript.h"
|
||||
#include "MotionMaster.h"
|
||||
#include "MoveSplineInit.h"
|
||||
#include "ObjectAccessor.h"
|
||||
#include "ObjectGuid.h"
|
||||
#include "Player.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "ScriptedGossip.h"
|
||||
#include "ScriptMgr.h"
|
||||
#include "Spell.h"
|
||||
#include "SpellInfo.h"
|
||||
#include "SpellScript.h"
|
||||
#include "TemporarySummon.h"
|
||||
#include "Transport.h"
|
||||
#include "Unit.h"
|
||||
|
||||
enum Text
|
||||
{
|
||||
@@ -344,12 +348,6 @@ Position const IceWallTargetPosition[] =
|
||||
{ 5318.289f, 1749.184f, 771.9423f, 0.8726646f } // 4th Icewall
|
||||
};
|
||||
|
||||
void GameObjectDeleteDelayEvent::DeleteGameObject()
|
||||
{
|
||||
if (GameObject* go = ObjectAccessor::GetGameObject(*_owner, _gameObjectGUID))
|
||||
go->Delete();
|
||||
}
|
||||
|
||||
class npc_jaina_or_sylvanas_intro_hor : public CreatureScript
|
||||
{
|
||||
public:
|
||||
@@ -797,6 +795,33 @@ class npc_jaina_or_sylvanas_intro_hor : public CreatureScript
|
||||
}
|
||||
};
|
||||
|
||||
class HoRGameObjectDeleteDelayEvent : public BasicEvent
|
||||
{
|
||||
public:
|
||||
explicit HoRGameObjectDeleteDelayEvent(Unit* owner, ObjectGuid gameObjectGUID) : _owner(owner), _gameObjectGUID(gameObjectGUID) { }
|
||||
|
||||
void DeleteGameObject()
|
||||
{
|
||||
if (GameObject* go = ObjectAccessor::GetGameObject(*_owner, _gameObjectGUID))
|
||||
go->Delete();
|
||||
}
|
||||
|
||||
bool Execute(uint64 /*execTime*/, uint32 /*diff*/) override
|
||||
{
|
||||
DeleteGameObject();
|
||||
return true;
|
||||
}
|
||||
|
||||
void Abort(uint64 /*execTime*/) override
|
||||
{
|
||||
DeleteGameObject();
|
||||
}
|
||||
|
||||
private:
|
||||
Unit* _owner;
|
||||
ObjectGuid _gameObjectGUID;
|
||||
};
|
||||
|
||||
class npc_jaina_or_sylvanas_escape_hor : public CreatureScript
|
||||
{
|
||||
public:
|
||||
@@ -894,7 +919,7 @@ class npc_jaina_or_sylvanas_escape_hor : public CreatureScript
|
||||
me->RemoveAurasDueToSpell(SPELL_SYLVANAS_DESTROY_ICE_WALL);
|
||||
|
||||
_instance->HandleGameObject(_instance->GetGuidData(DATA_ICEWALL), true);
|
||||
me->m_Events.AddEvent(new GameObjectDeleteDelayEvent(me, _instance->GetGuidData(DATA_ICEWALL)), me->m_Events.CalculateTime(5000));
|
||||
me->m_Events.AddEvent(new HoRGameObjectDeleteDelayEvent(me, _instance->GetGuidData(DATA_ICEWALL)), me->m_Events.CalculateTime(5000));
|
||||
|
||||
if (Creature* wallTarget = ObjectAccessor::GetCreature(*me, _instance->GetGuidData(DATA_ICEWALL_TARGET)))
|
||||
wallTarget->DespawnOrUnsummon();
|
||||
@@ -2123,13 +2148,10 @@ enum EscapeEvents
|
||||
EVENT_LUMBERING_ABOMINATION_CLEAVE
|
||||
};
|
||||
|
||||
namespace hor
|
||||
{
|
||||
|
||||
class StartMovementEvent : public BasicEvent
|
||||
class HoRStartMovementEvent : public BasicEvent
|
||||
{
|
||||
public:
|
||||
StartMovementEvent(Creature* owner) : _owner(owner) { }
|
||||
explicit HoRStartMovementEvent(Creature* owner) : _owner(owner) { }
|
||||
|
||||
bool Execute(uint64 /*execTime*/, uint32 /*diff*/) override
|
||||
{
|
||||
@@ -2143,8 +2165,6 @@ class StartMovementEvent : public BasicEvent
|
||||
Creature* _owner;
|
||||
};
|
||||
|
||||
} // namespace hor
|
||||
|
||||
struct npc_escape_event_trash : public ScriptedAI
|
||||
{
|
||||
npc_escape_event_trash(Creature* creature) : ScriptedAI(creature), _instance(creature->GetInstanceScript()) { }
|
||||
@@ -2197,7 +2217,7 @@ class npc_raging_ghoul : public CreatureScript
|
||||
me->CastSpell(me, SPELL_RAGING_GHOUL_SPAWN, true);
|
||||
me->SetReactState(REACT_PASSIVE);
|
||||
me->HandleEmoteCommand(EMOTE_ONESHOT_EMERGE);
|
||||
me->m_Events.AddEvent(new hor::StartMovementEvent(me), me->m_Events.CalculateTime(5000));
|
||||
me->m_Events.AddEvent(new HoRStartMovementEvent(me), me->m_Events.CalculateTime(5000));
|
||||
|
||||
npc_escape_event_trash::IsSummonedBy(summoner);
|
||||
}
|
||||
@@ -2263,7 +2283,7 @@ class npc_risen_witch_doctor : public CreatureScript
|
||||
me->CastSpell(me, SPELL_RISEN_WITCH_DOCTOR_SPAWN, true);
|
||||
me->SetReactState(REACT_PASSIVE);
|
||||
me->HandleEmoteCommand(EMOTE_ONESHOT_EMERGE);
|
||||
me->m_Events.AddEvent(new hor::StartMovementEvent(me), me->m_Events.CalculateTime(5000));
|
||||
me->m_Events.AddEvent(new HoRStartMovementEvent(me), me->m_Events.CalculateTime(5000));
|
||||
|
||||
npc_escape_event_trash::IsSummonedBy(summoner);
|
||||
}
|
||||
|
||||
@@ -19,21 +19,20 @@
|
||||
#define HALLS_OF_REFLECTION_H_
|
||||
|
||||
#include "CreatureAIImpl.h"
|
||||
#include "EventProcessor.h"
|
||||
#include "ObjectGuid.h"
|
||||
|
||||
class Unit;
|
||||
|
||||
#define HoRScriptName "instance_halls_of_reflection"
|
||||
#define DataHeader "HOR"
|
||||
#define DataHeader "HOR"
|
||||
|
||||
uint32 const EncounterCount = 3;
|
||||
|
||||
/* Halls of Reflection encounters:
|
||||
0 - Falric
|
||||
1 - Marwyn
|
||||
2 - The Lich King
|
||||
*/
|
||||
/*
|
||||
* Halls of Reflection encounters:
|
||||
* 0 - Falric
|
||||
* 1 - Marwyn
|
||||
* 2 - The Lich King
|
||||
*/
|
||||
|
||||
enum HORDataTypes
|
||||
{
|
||||
@@ -198,29 +197,6 @@ enum HORInstanceYells
|
||||
SAY_CAPTAIN_FINAL = 1
|
||||
};
|
||||
|
||||
class GameObjectDeleteDelayEvent : public BasicEvent
|
||||
{
|
||||
public:
|
||||
GameObjectDeleteDelayEvent(Unit* owner, ObjectGuid gameObjectGUID) : _owner(owner), _gameObjectGUID(gameObjectGUID) { }
|
||||
|
||||
void DeleteGameObject();
|
||||
|
||||
bool Execute(uint64 /*execTime*/, uint32 /*diff*/) override
|
||||
{
|
||||
DeleteGameObject();
|
||||
return true;
|
||||
}
|
||||
|
||||
void Abort(uint64 /*execTime*/) override
|
||||
{
|
||||
DeleteGameObject();
|
||||
}
|
||||
|
||||
private:
|
||||
Unit* _owner;
|
||||
ObjectGuid _gameObjectGUID;
|
||||
};
|
||||
|
||||
template <class AI, class T>
|
||||
inline AI* GetHallsOfReflectionAI(T* obj)
|
||||
{
|
||||
|
||||
@@ -476,7 +476,7 @@ public:
|
||||
Movement::MoveSplineInit init(_owner);
|
||||
init.DisableTransportPathTransformations();
|
||||
init.MoveTo(_dest.GetPositionX(), _dest.GetPositionY(), _dest.GetPositionZ(), false);
|
||||
_owner->GetMotionMaster()->LaunchMoveSpline(std::move(init), EVENT_CHARGE_PREPATH, MOTION_SLOT_ACTIVE, POINT_MOTION_TYPE);
|
||||
_owner->GetMotionMaster()->LaunchMoveSpline(std::move(init), EVENT_CHARGE_PREPATH, MOTION_PRIORITY_NORMAL, POINT_MOTION_TYPE);
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -570,7 +570,7 @@ struct gunship_npc_AI : public ScriptedAI
|
||||
Movement::MoveSplineInit init(me);
|
||||
init.DisableTransportPathTransformations();
|
||||
init.MoveTo(x, y, z, false);
|
||||
me->GetMotionMaster()->LaunchMoveSpline(std::move(init), EVENT_CHARGE_PREPATH, MOTION_SLOT_ACTIVE, POINT_MOTION_TYPE);
|
||||
me->GetMotionMaster()->LaunchMoveSpline(std::move(init), EVENT_CHARGE_PREPATH, MOTION_PRIORITY_NORMAL, POINT_MOTION_TYPE);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -937,7 +937,7 @@ class npc_high_overlord_saurfang_igb : public CreatureScript
|
||||
Movement::MoveSplineInit init(me);
|
||||
init.DisableTransportPathTransformations();
|
||||
init.MovebyPath(path, 0);
|
||||
me->GetMotionMaster()->LaunchMoveSpline(std::move(init), 0, MOTION_SLOT_ACTIVE, POINT_MOTION_TYPE);
|
||||
me->GetMotionMaster()->LaunchMoveSpline(std::move(init), 0, MOTION_PRIORITY_NORMAL, POINT_MOTION_TYPE);
|
||||
|
||||
me->DespawnOrUnsummon(18000);
|
||||
}
|
||||
@@ -1201,7 +1201,7 @@ class npc_muradin_bronzebeard_igb : public CreatureScript
|
||||
Movement::MoveSplineInit init(me);
|
||||
init.DisableTransportPathTransformations();
|
||||
init.MovebyPath(path, 0);
|
||||
me->GetMotionMaster()->LaunchMoveSpline(std::move(init), 0, MOTION_SLOT_ACTIVE, POINT_MOTION_TYPE);
|
||||
me->GetMotionMaster()->LaunchMoveSpline(std::move(init), 0, MOTION_PRIORITY_NORMAL, POINT_MOTION_TYPE);
|
||||
|
||||
me->DespawnOrUnsummon(18000);
|
||||
}
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
#include "MoveSplineInit.h"
|
||||
#include "ObjectAccessor.h"
|
||||
#include "Player.h"
|
||||
#include "PointMovementGenerator.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "SpellAuras.h"
|
||||
#include "SpellScript.h"
|
||||
@@ -241,8 +242,16 @@ class boss_lord_marrowgar : public CreatureScript
|
||||
break;
|
||||
}
|
||||
case EVENT_BONE_STORM_END:
|
||||
if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() == POINT_MOTION_TYPE)
|
||||
me->GetMotionMaster()->MovementExpired();
|
||||
if (MovementGenerator* movement = me->GetMotionMaster()->GetMovementGenerator([](MovementGenerator const* a) -> bool
|
||||
{
|
||||
if (a->GetMovementGeneratorType() == POINT_MOTION_TYPE)
|
||||
{
|
||||
PointMovementGenerator<Creature> const* pointMovement = dynamic_cast<PointMovementGenerator<Creature> const*>(a);
|
||||
return pointMovement && pointMovement->GetId() == POINT_TARGET_BONESTORM_PLAYER;
|
||||
}
|
||||
return false;
|
||||
}))
|
||||
me->GetMotionMaster()->Remove(movement);
|
||||
me->GetMotionMaster()->MoveChase(me->GetVictim());
|
||||
me->SetSpeedRate(MOVE_RUN, _baseSpeed);
|
||||
events.CancelEvent(EVENT_BONE_STORM_MOVE);
|
||||
@@ -472,7 +481,7 @@ class npc_bone_spike : public CreatureScript
|
||||
Movement::MoveSplineInit init(passenger);
|
||||
init.DisableTransportPathTransformations();
|
||||
init.MoveTo(-0.02206125f, -0.02132235f, 5.514783f, false);
|
||||
passenger->GetMotionMaster()->LaunchMoveSpline(std::move(init), EVENT_VEHICLE_BOARD, MOTION_SLOT_CONTROLLED);
|
||||
passenger->GetMotionMaster()->LaunchMoveSpline(std::move(init), EVENT_VEHICLE_BOARD, MOTION_PRIORITY_HIGHEST);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
|
||||
@@ -242,8 +242,6 @@ class boss_professor_putricide : public CreatureScript
|
||||
_experimentState = EXPERIMENT_STATE_OOZE;
|
||||
me->SetReactState(REACT_DEFENSIVE);
|
||||
me->SetWalk(false);
|
||||
if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() == POINT_MOTION_TYPE)
|
||||
me->GetMotionMaster()->MovementExpired();
|
||||
|
||||
if (instance->GetBossState(DATA_ROTFACE) == DONE && instance->GetBossState(DATA_FESTERGUT) == DONE)
|
||||
{
|
||||
|
||||
@@ -394,8 +394,7 @@ class boss_sindragosa : public CreatureScript
|
||||
me->SetDisableGravity(false);
|
||||
me->SetAnimTier(UNIT_BYTE1_FLAG_NONE, false);
|
||||
me->SetReactState(REACT_DEFENSIVE);
|
||||
if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() == POINT_MOTION_TYPE)
|
||||
me->GetMotionMaster()->MovementExpired();
|
||||
|
||||
_isInAirPhase = false;
|
||||
// trigger Asphyxiation
|
||||
EntryCheckPredicate pred(NPC_ICE_TOMB);
|
||||
|
||||
@@ -418,10 +418,10 @@ class FrozenThroneResetWorker
|
||||
}
|
||||
};
|
||||
|
||||
class StartMovementEvent : public BasicEvent
|
||||
class LichKingStartMovementEvent : public BasicEvent
|
||||
{
|
||||
public:
|
||||
StartMovementEvent(Creature* summoner, Creature* owner)
|
||||
LichKingStartMovementEvent(Creature* summoner, Creature* owner)
|
||||
: _summonerGuid(summoner->GetGUID()), _owner(owner)
|
||||
{
|
||||
}
|
||||
@@ -714,7 +714,7 @@ class boss_the_lich_king : public CreatureScript
|
||||
summon->CastSpell(summon, SPELL_RISEN_WITCH_DOCTOR_SPAWN, true);
|
||||
summon->SetReactState(REACT_PASSIVE);
|
||||
summon->HandleEmoteCommand(EMOTE_ONESHOT_EMERGE);
|
||||
summon->m_Events.AddEvent(new StartMovementEvent(me, summon), summon->m_Events.CalculateTime(5000));
|
||||
summon->m_Events.AddEvent(new LichKingStartMovementEvent(me, summon), summon->m_Events.CalculateTime(5000));
|
||||
break;
|
||||
case NPC_ICE_SPHERE:
|
||||
{
|
||||
@@ -1667,7 +1667,7 @@ class npc_strangulate_vehicle : public CreatureScript
|
||||
switch (eventId)
|
||||
{
|
||||
case EVENT_TELEPORT:
|
||||
me->GetMotionMaster()->Clear(false);
|
||||
me->GetMotionMaster()->Clear();
|
||||
me->GetMotionMaster()->MoveIdle();
|
||||
if (TempSummon* summ = me->ToTempSummon())
|
||||
{
|
||||
|
||||
@@ -1292,7 +1292,7 @@ struct npc_argent_captainAI : public ScriptedAI
|
||||
me->SetReactState(REACT_DEFENSIVE);
|
||||
FollowAngle = me->GetAbsoluteAngle(crok) + me->GetOrientation();
|
||||
FollowDist = me->GetDistance2d(crok);
|
||||
me->GetMotionMaster()->MoveFollow(crok, FollowDist, FollowAngle, MOTION_SLOT_IDLE);
|
||||
me->GetMotionMaster()->MoveFollow(crok, FollowDist, FollowAngle, MOTION_SLOT_DEFAULT);
|
||||
}
|
||||
|
||||
me->setActive(true);
|
||||
@@ -1320,7 +1320,7 @@ struct npc_argent_captainAI : public ScriptedAI
|
||||
void EnterEvadeMode(EvadeReason why) override
|
||||
{
|
||||
// not yet following
|
||||
if (me->GetMotionMaster()->GetMotionSlotType(MOTION_SLOT_IDLE) != CHASE_MOTION_TYPE || IsUndead)
|
||||
if (me->GetMotionMaster()->GetCurrentMovementGeneratorType(MOTION_SLOT_DEFAULT) != FOLLOW_MOTION_TYPE || IsUndead)
|
||||
{
|
||||
ScriptedAI::EnterEvadeMode(why);
|
||||
return;
|
||||
@@ -1331,9 +1331,9 @@ struct npc_argent_captainAI : public ScriptedAI
|
||||
|
||||
if (!me->GetVehicle())
|
||||
{
|
||||
me->GetMotionMaster()->Clear(false);
|
||||
me->GetMotionMaster()->Clear();
|
||||
if (Creature* crok = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_CROK_SCOURGEBANE)))
|
||||
me->GetMotionMaster()->MoveFollow(crok, FollowDist, FollowAngle, MOTION_SLOT_IDLE);
|
||||
me->GetMotionMaster()->MoveFollow(crok, FollowDist, FollowAngle, MOTION_SLOT_DEFAULT);
|
||||
}
|
||||
|
||||
Reset();
|
||||
|
||||
@@ -500,7 +500,7 @@ public:
|
||||
DummyEntryCheckPredicate pred;
|
||||
summons.DoAction(ACTION_DELAYED_DESPAWN, pred);
|
||||
Talk(SAY_END_P_TWO);
|
||||
me->GetMotionMaster()->Clear(false);
|
||||
me->GetMotionMaster()->Clear();
|
||||
me->StopMoving();
|
||||
if (me->GetPositionZ() > 300.0f)
|
||||
events.ScheduleEvent(EVENT_DELAY_MOVE_TO_DESTROY_P, 5*IN_MILLISECONDS, 0, PHASE_TWO);
|
||||
|
||||
@@ -417,21 +417,21 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
void DamageTaken(Unit* /*pDoneBy*/, uint32 &uiDamage) override
|
||||
void DamageTaken(Unit* /*attacker*/, uint32& damage) override
|
||||
{
|
||||
if (uiDamage > me->GetHealth())
|
||||
if (damage >= me->GetHealth())
|
||||
{
|
||||
me->UpdateEntry(NPC_BRITTLE_GOLEM);
|
||||
me->SetHealth(1);
|
||||
uiDamage = 0;
|
||||
damage = 0;
|
||||
me->RemoveAllAuras();
|
||||
me->AttackStop();
|
||||
// me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED); //Set in DB
|
||||
// me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); //Set in DB
|
||||
// me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED); // Set in DB
|
||||
// me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); // Set in DB
|
||||
if (me->IsNonMeleeSpellCast(false))
|
||||
me->InterruptNonMeleeSpells(false);
|
||||
if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() == CHASE_MOTION_TYPE)
|
||||
me->GetMotionMaster()->MovementExpired();
|
||||
|
||||
me->GetMotionMaster()->Clear();
|
||||
m_bIsFrozen = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -357,7 +357,7 @@ class boss_algalon_the_observer : public CreatureScript
|
||||
Movement::MoveSplineInit init(me);
|
||||
init.MoveTo(AlgalonLandPos.GetPositionX(), AlgalonLandPos.GetPositionY(), AlgalonLandPos.GetPositionZ(), false);
|
||||
init.SetOrientationFixed(true);
|
||||
me->GetMotionMaster()->LaunchMoveSpline(std::move(init), POINT_ALGALON_LAND, MOTION_SLOT_ACTIVE, POINT_MOTION_TYPE);
|
||||
me->GetMotionMaster()->LaunchMoveSpline(std::move(init), POINT_ALGALON_LAND, MOTION_PRIORITY_NORMAL, POINT_MOTION_TYPE);
|
||||
|
||||
events.Reset();
|
||||
events.SetPhase(PHASE_ROLE_PLAY);
|
||||
|
||||
@@ -1134,7 +1134,7 @@ class boss_aerial_command_unit : public CreatureScript
|
||||
|
||||
if (events.IsInPhase(PHASE_AERIAL_COMMAND_UNIT))
|
||||
{
|
||||
me->GetMotionMaster()->Clear(true);
|
||||
me->GetMotionMaster()->Clear();
|
||||
me->GetMotionMaster()->MovePoint(WP_AERIAL_P4_POS, VehicleRelocation[WP_AERIAL_P4_POS]);
|
||||
}
|
||||
else if (events.IsInPhase(PHASE_VOL7RON))
|
||||
|
||||
@@ -335,7 +335,7 @@ struct boss_razorscale : public BossAI
|
||||
init.MovebyPath(path, 0);
|
||||
init.SetCyclic();
|
||||
init.SetFly();
|
||||
me->GetMotionMaster()->LaunchMoveSpline(std::move(init), 0, MOTION_SLOT_ACTIVE, POINT_MOTION_TYPE);
|
||||
me->GetMotionMaster()->LaunchMoveSpline(std::move(init), 0, MOTION_PRIORITY_NORMAL, POINT_MOTION_TYPE);
|
||||
}
|
||||
|
||||
bool CanAIAttack(Unit const* target) const override
|
||||
|
||||
@@ -641,7 +641,7 @@ class boss_thorim : public CreatureScript
|
||||
|
||||
Movement::MoveSplineInit init(summon);
|
||||
init.MovebyPath(path);
|
||||
summon->GetMotionMaster()->LaunchMoveSpline(std::move(init), 0, MOTION_SLOT_ACTIVE, POINT_MOTION_TYPE);
|
||||
summon->GetMotionMaster()->LaunchMoveSpline(std::move(init), 0, MOTION_PRIORITY_NORMAL, POINT_MOTION_TYPE);
|
||||
break;
|
||||
}
|
||||
case NPC_DARK_RUNE_CHAMPION:
|
||||
|
||||
@@ -256,7 +256,7 @@ class npc_vrykul_skeleton : public CreatureScript
|
||||
events.ScheduleEvent(EVENT_DECREPIFY, urand(4, 6) * IN_MILLISECONDS);
|
||||
}
|
||||
|
||||
void DamageTaken(Unit* /*doneBy*/, uint32& damage) override
|
||||
void DamageTaken(Unit* /*attacker*/, uint32& damage) override
|
||||
{
|
||||
if (damage >= me->GetHealth())
|
||||
{
|
||||
@@ -273,7 +273,7 @@ class npc_vrykul_skeleton : public CreatureScript
|
||||
events.Reset();
|
||||
events.ScheduleEvent(EVENT_RESURRECT, urand(18, 22) * IN_MILLISECONDS);
|
||||
|
||||
me->GetMotionMaster()->MovementExpired(false);
|
||||
me->GetMotionMaster()->Clear();
|
||||
me->GetMotionMaster()->MoveIdle();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -363,7 +363,7 @@ public:
|
||||
Movement::MoveSplineInit init(who);
|
||||
init.DisableTransportPathTransformations();
|
||||
init.MoveTo(0.3320355f, 0.05355075f, 5.196949f, false);
|
||||
who->GetMotionMaster()->LaunchMoveSpline(std::move(init), EVENT_VEHICLE_BOARD, MOTION_SLOT_CONTROLLED);
|
||||
who->GetMotionMaster()->LaunchMoveSpline(std::move(init), EVENT_VEHICLE_BOARD, MOTION_PRIORITY_HIGHEST);
|
||||
|
||||
me->setActive(true);
|
||||
me->SetFarVisible(true);
|
||||
|
||||
@@ -718,7 +718,7 @@ public:
|
||||
owner->RemoveAllAurasExceptType(SPELL_AURA_DUMMY);
|
||||
owner->CombatStop(true);
|
||||
owner->GetThreatManager().ClearAllThreat();
|
||||
owner->GetMotionMaster()->Clear(false);
|
||||
owner->GetMotionMaster()->Clear();
|
||||
owner->GetMotionMaster()->MoveFollow(GetCaster(), 4.0f, 0.0f);
|
||||
owner->CastSpell(owner, SPELL_SUBDUED, true);
|
||||
GetCaster()->CastSpell(GetCaster(), SPELL_DRAKE_HATCHLING_SUBDUED, true);
|
||||
|
||||
@@ -898,7 +898,7 @@ public:
|
||||
{
|
||||
_finished = false;
|
||||
me->SetVisible(true);
|
||||
me->GetMotionMaster()->Clear(true);
|
||||
me->GetMotionMaster()->Clear();
|
||||
}
|
||||
|
||||
void DoAction(int32 /*action*/) override
|
||||
|
||||
@@ -151,8 +151,7 @@ class boss_nexusprince_shaffar : public CreatureScript
|
||||
|
||||
// expire movement, will prevent from running right back to victim after cast
|
||||
// (but should MoveChase be used again at a certain time or should he not move?)
|
||||
if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() == CHASE_MOTION_TYPE)
|
||||
me->GetMotionMaster()->MovementExpired();
|
||||
me->GetMotionMaster()->Clear(MOTION_PRIORITY_NORMAL);
|
||||
|
||||
DoCast(me, SPELL_BLINK);
|
||||
break;
|
||||
|
||||
@@ -724,7 +724,7 @@ struct npc_ashtongue_sorcerer : public ScriptedAI
|
||||
{
|
||||
_inBanish = true;
|
||||
me->StopMoving();
|
||||
me->GetMotionMaster()->Clear(false);
|
||||
me->GetMotionMaster()->Clear();
|
||||
me->GetMotionMaster()->MovePoint(1, me->GetPositionX() + frand(-8.0f, 8.0f), me->GetPositionY() + frand(-8.0f, 8.0f), me->GetPositionZ());
|
||||
|
||||
_scheduler.Schedule(Seconds(1) + Milliseconds(500), [this](TaskContext sorcer_channel)
|
||||
|
||||
@@ -248,7 +248,7 @@ public:
|
||||
{
|
||||
Talk(EMOTE_SPOUT);
|
||||
me->SetReactState(REACT_PASSIVE);
|
||||
me->GetMotionMaster()->MoveRotate(20000, urand(0, 1) ? ROTATE_DIRECTION_LEFT : ROTATE_DIRECTION_RIGHT);
|
||||
me->GetMotionMaster()->MoveRotate(0, 20000, urand(0, 1) ? ROTATE_DIRECTION_LEFT : ROTATE_DIRECTION_RIGHT);
|
||||
SpoutTimer = 45000;
|
||||
WhirlTimer = 20000; // whirl directly after spout
|
||||
RotTimer = 20000;
|
||||
@@ -266,7 +266,7 @@ public:
|
||||
else
|
||||
WhirlTimer -= diff;
|
||||
|
||||
if (CheckTimer <= diff)//check if there are players in melee range
|
||||
if (CheckTimer <= diff) // check if there are players in melee range
|
||||
{
|
||||
InRange = false;
|
||||
Map::PlayerList const& PlayerList = me->GetMap()->GetPlayers();
|
||||
|
||||
@@ -287,9 +287,6 @@ public:
|
||||
{
|
||||
if (GameObject* go = unit->FindNearestGameObject(GO_CARCASS, 10))
|
||||
{
|
||||
if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() == WAYPOINT_MOTION_TYPE)
|
||||
me->GetMotionMaster()->MovementExpired();
|
||||
|
||||
me->GetMotionMaster()->MoveIdle();
|
||||
me->StopMoving();
|
||||
|
||||
@@ -328,7 +325,9 @@ public:
|
||||
{
|
||||
DoCastVictim(SPELL_NETHER_BREATH);
|
||||
CastTimer = 5000;
|
||||
} else CastTimer -= diff;
|
||||
}
|
||||
else
|
||||
CastTimer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
@@ -96,7 +96,7 @@ class npc_pet_dk_ebon_gargoyle : public CreatureScript
|
||||
float x = me->GetPositionX() + 20 * std::cos(me->GetOrientation());
|
||||
float y = me->GetPositionY() + 20 * std::sin(me->GetOrientation());
|
||||
float z = me->GetPositionZ() + 40;
|
||||
me->GetMotionMaster()->Clear(false);
|
||||
me->GetMotionMaster()->Clear();
|
||||
me->GetMotionMaster()->MovePoint(0, x, y, z);
|
||||
|
||||
// Despawn as soon as possible
|
||||
|
||||
@@ -190,8 +190,8 @@ class npc_pet_mage_mirror_image : public CreatureScript
|
||||
me->CombatStop(true);
|
||||
if (owner && !me->HasUnitState(UNIT_STATE_FOLLOW))
|
||||
{
|
||||
me->GetMotionMaster()->Clear(false);
|
||||
me->GetMotionMaster()->MoveFollow(owner, PET_FOLLOW_DIST, me->GetFollowAngle(), MOTION_SLOT_ACTIVE);
|
||||
me->GetMotionMaster()->Clear();
|
||||
me->GetMotionMaster()->MoveFollow(owner, PET_FOLLOW_DIST, me->GetFollowAngle());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -198,13 +198,13 @@ class npc_dream_fog : public CreatureScript
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true))
|
||||
{
|
||||
_roamTimer = urand(15000, 30000);
|
||||
me->GetMotionMaster()->Clear(false);
|
||||
me->GetMotionMaster()->Clear();
|
||||
me->GetMotionMaster()->MoveChase(target, 0.2f);
|
||||
}
|
||||
else
|
||||
{
|
||||
_roamTimer = 2500;
|
||||
me->GetMotionMaster()->Clear(false);
|
||||
me->GetMotionMaster()->Clear();
|
||||
me->GetMotionMaster()->MoveRandom(25.0f);
|
||||
}
|
||||
// Seeping fog movement is slow enough for a player to be able to walk backwards and still outpace it
|
||||
|
||||
@@ -2821,7 +2821,7 @@ public:
|
||||
init.DisableTransportPathTransformations();
|
||||
init.MoveTo(x, y, z, false);
|
||||
init.SetFacing(o);
|
||||
who->GetMotionMaster()->LaunchMoveSpline(std::move(init), EVENT_VEHICLE_BOARD, MOTION_SLOT_CONTROLLED);
|
||||
who->GetMotionMaster()->LaunchMoveSpline(std::move(init), EVENT_VEHICLE_BOARD, MOTION_PRIORITY_HIGHEST);
|
||||
who->m_Events.AddEvent(new CastFoodSpell(who, _chairSpells.at(who->GetEntry())), who->m_Events.CalculateTime(1000));
|
||||
if (Creature* creature = who->ToCreature())
|
||||
creature->SetDisplayFromModel(0);
|
||||
|
||||
Reference in New Issue
Block a user