Core/SAI: Drop waypoints table and move existing rows to waypoint_data table (#28834)

This commit is contained in:
ModoX
2023-04-08 01:33:05 +02:00
committed by GitHub
parent 7d5d3cf655
commit 356c98579b
27 changed files with 110 additions and 188 deletions
@@ -0,0 +1,29 @@
-- Shift existing rows by 3 bits to reserve space for 3 other tables
UPDATE `waypoint_data` SET `id`=(`id` << 3) ORDER BY `id` DESC;
UPDATE `creature_addon` SET `path_id`=(`path_id` << 3);
UPDATE `event_scripts` SET `datalong`=(`datalong` << 3) WHERE `command`=20 AND `datalong` > 0;
UPDATE `event_scripts` SET `dataint`=(`dataint` << 3) WHERE `command`=35 AND `datalong`=2 AND `dataint` > 0;
UPDATE `spell_scripts` SET `datalong`=(`datalong` << 3) WHERE `command`=20 AND `datalong` > 0;
UPDATE `spell_scripts` SET `dataint`=(`dataint` << 3) WHERE `command`=35 AND `datalong`=2 AND `dataint` > 0;
UPDATE `waypoint_scripts` SET `datalong`=(`datalong` << 3) WHERE `command`=20 AND `datalong` > 0;
UPDATE `waypoint_scripts` SET `dataint`=(`dataint` << 3) WHERE `command`=35 AND `datalong`=2 AND `dataint` > 0;
-- use bit 0 for waypoints
DELETE FROM `waypoint_data` WHERE `id` & 1;
INSERT INTO `waypoint_data` (`id`, `point`, `position_x`, `position_y`, `position_z`, `orientation`, `delay`, `move_type`)
SELECT ((w.`entry` << 3) | 1), w.`pointid`, w.`position_x`, w.`position_y`, w.`position_z`, w.`orientation`, w.`delay`, MAX(IFNULL(ss.`action_param1`, 0))
FROM `waypoints` w
LEFT JOIN `smart_scripts` ss ON w.`entry`=ss.`action_param2` AND ss.`action_type`=53 AND ss.`action_param2` > 0
GROUP BY ((w.`entry` << 3) | 1), w.`pointid`, w.`position_x`, w.`position_y`, w.`position_z`, w.`orientation`, w.`delay`;
UPDATE `smart_scripts` SET `action_param2`=((`action_param2` << 3) | 1) WHERE `action_type`=53 AND `action_param2` > 0;
UPDATE `smart_scripts` SET `action_param1`=((`action_param1` << 3) | 1) WHERE `action_type`=113 AND `action_param1` > 0;
UPDATE `smart_scripts` SET `action_param2`=((`action_param2` << 3) | 1) WHERE `action_type`=113 AND `action_param2` > 0;
UPDATE `smart_scripts` SET `action_param3`=((`action_param3` << 3) | 1) WHERE `action_type`=113 AND `action_param3` > 0;
UPDATE `smart_scripts` SET `action_param4`=((`action_param4` << 3) | 1) WHERE `action_type`=113 AND `action_param4` > 0;
UPDATE `smart_scripts` SET `action_param5`=((`action_param5` << 3) | 1) WHERE `action_type`=113 AND `action_param5` > 0;
UPDATE `smart_scripts` SET `action_param6`=((`action_param6` << 3) | 1) WHERE `action_type`=113 AND `action_param6` > 0;
UPDATE `smart_scripts` SET `action_param7`=((`action_param7` << 3) | 1) WHERE `action_type`=113 AND `action_param7` > 0;
UPDATE `smart_scripts` SET `event_param2`=((`event_param2` << 3) | 1) WHERE `event_type` IN(40, 55, 56, 57, 58) AND `event_param2` > 0;
DROP TABLE IF EXISTS `waypoints`;
@@ -28,7 +28,6 @@ void WorldDatabaseConnection::DoPrepareStatements()
PrepareStatement(WORLD_REP_LINKED_RESPAWN, "REPLACE INTO linked_respawn (guid, linkedGuid, linkType) VALUES (?, ?, ?)", CONNECTION_ASYNC);
PrepareStatement(WORLD_SEL_CREATURE_TEXT, "SELECT CreatureID, GroupID, ID, Text, Type, Language, Probability, Emote, Duration, Sound, SoundPlayType, BroadcastTextId, TextRange FROM creature_text", CONNECTION_SYNCH);
PrepareStatement(WORLD_SEL_SMART_SCRIPTS, "SELECT entryorguid, source_type, id, link, event_type, event_phase_mask, event_chance, event_flags, event_param1, event_param2, event_param3, event_param4, event_param5, event_param_string, action_type, action_param1, action_param2, action_param3, action_param4, action_param5, action_param6, action_param7, target_type, target_param1, target_param2, target_param3, target_param4, target_x, target_y, target_z, target_o FROM smart_scripts ORDER BY entryorguid, source_type, id, link", CONNECTION_SYNCH);
PrepareStatement(WORLD_SEL_SMARTAI_WP, "SELECT entry, pointid, position_x, position_y, position_z, orientation, delay FROM waypoints ORDER BY entry, pointid", CONNECTION_SYNCH);
PrepareStatement(WORLD_DEL_GAMEOBJECT, "DELETE FROM gameobject WHERE guid = ?", CONNECTION_ASYNC);
PrepareStatement(WORLD_DEL_EVENT_GAMEOBJECT, "DELETE FROM game_event_gameobject WHERE guid = ?", CONNECTION_ASYNC);
PrepareStatement(WORLD_INS_GRAVEYARD_ZONE, "INSERT INTO graveyard_zone (ID, GhostZone, Faction) VALUES (?, ?, ?)", CONNECTION_ASYNC);
@@ -33,7 +33,6 @@ enum WorldDatabaseStatements : uint32
WORLD_REP_LINKED_RESPAWN,
WORLD_SEL_CREATURE_TEXT,
WORLD_SEL_SMART_SCRIPTS,
WORLD_SEL_SMARTAI_WP,
WORLD_DEL_GAMEOBJECT,
WORLD_DEL_EVENT_GAMEOBJECT,
WORLD_INS_GRAVEYARD_ZONE,
+17 -30
View File
@@ -30,6 +30,7 @@
#include "Player.h"
#include "ScriptMgr.h"
#include "Vehicle.h"
#include "WaypointManager.h"
SmartAI::SmartAI(Creature* creature, uint32 scriptId) : CreatureAI(creature, scriptId), _charmed(false), _followCreditType(0), _followArrivedTimer(0), _followCredit(0), _followArrivedEntry(0), _followDistance(0.f), _followAngle(0.f),
_escortState(SMART_ESCORT_NONE), _escortNPCFlags(0), _escortInvokerCheckTimer(1000), _currentWaypointNode(0), _waypointReached(false), _waypointPauseTimer(0), _waypointPauseForced(false), _repeatWaypointPath(false),
@@ -44,20 +45,16 @@ bool SmartAI::IsAIControlled() const
return !_charmed;
}
void SmartAI::StartPath(bool run/* = false*/, uint32 pathId/* = 0*/, bool repeat/* = false*/, Unit* invoker/* = nullptr*/, uint32 nodeId/* = 1*/)
void SmartAI::StartPath(uint32 pathId/* = 0*/, bool repeat/* = false*/, Unit* invoker/* = nullptr*/, uint32 nodeId/* = 1*/)
{
if (HasEscortState(SMART_ESCORT_ESCORTING))
StopPath();
SetRun(run);
if (!pathId)
return;
if (pathId)
{
if (!LoadPath(pathId))
return;
}
if (_path.nodes.empty())
WaypointPath const* path = LoadPath(pathId);
if (!path)
return;
_currentWaypointNode = nodeId;
@@ -74,32 +71,23 @@ void SmartAI::StartPath(bool run/* = false*/, uint32 pathId/* = 0*/, bool repeat
me->ReplaceAllNpcFlags(UNIT_NPC_FLAG_NONE);
}
me->GetMotionMaster()->MovePath(_path, _repeatWaypointPath);
me->GetMotionMaster()->MovePath(*path, _repeatWaypointPath);
}
bool SmartAI::LoadPath(uint32 entry)
WaypointPath const* SmartAI::LoadPath(uint32 entry)
{
if (HasEscortState(SMART_ESCORT_ESCORTING))
return false;
return nullptr;
WaypointPath const* path = sSmartWaypointMgr->GetPath(entry);
WaypointPath const* path = sWaypointMgr->GetPath(entry);
if (!path || path->nodes.empty())
{
GetScript()->SetPathId(0);
return false;
}
_path.id = path->id;
_path.nodes = path->nodes;
for (WaypointNode& waypoint : _path.nodes)
{
Trinity::NormalizeMapCoord(waypoint.x);
Trinity::NormalizeMapCoord(waypoint.y);
waypoint.moveType = _run ? WAYPOINT_MOVE_TYPE_RUN : WAYPOINT_MOVE_TYPE_WALK;
return nullptr;
}
GetScript()->SetPathId(entry);
return true;
return path;
}
void SmartAI::PausePath(uint32 delay, bool forced)
@@ -190,7 +178,7 @@ void SmartAI::StopPath(uint32 DespawnTime, uint32 quest, bool fail)
void SmartAI::EndPath(bool fail)
{
RemoveEscortState(SMART_ESCORT_ESCORTING | SMART_ESCORT_PAUSED | SMART_ESCORT_RETURNING);
_path.nodes.clear();
_waypointPauseTimer = 0;
if (_escortNPCFlags)
@@ -252,7 +240,7 @@ void SmartAI::EndPath(bool fail)
if (_repeatWaypointPath)
{
if (IsAIControlled())
StartPath(_run, GetScript()->GetPathId(), _repeatWaypointPath);
StartPath(GetScript()->GetPathId(), _repeatWaypointPath);
}
else if (pathid == GetScript()->GetPathId()) // if it's not the same pathid, our script wants to start another path; don't override it
GetScript()->SetPathId(0);
@@ -373,7 +361,8 @@ void SmartAI::WaypointReached(uint32 nodeId, uint32 pathId)
}
else if (HasEscortState(SMART_ESCORT_ESCORTING) && me->GetMotionMaster()->GetCurrentMovementGeneratorType() == WAYPOINT_MOTION_TYPE)
{
if (_currentWaypointNode == _path.nodes.size())
WaypointPath const* path = sWaypointMgr->GetPath(pathId);
if (path && _currentWaypointNode == path->nodes.size())
_waypointPathEnded = true;
else
SetRun(_run);
@@ -703,7 +692,7 @@ void SmartAI::OnCharmed(bool isNew)
if (!charmed && !me->IsInEvadeMode())
{
if (_repeatWaypointPath)
StartPath(_run, GetScript()->GetPathId(), true);
StartPath(GetScript()->GetPathId(), true);
else
me->SetWalk(!_run);
@@ -751,8 +740,6 @@ void SmartAI::SetRun(bool run)
{
me->SetWalk(!run);
_run = run;
for (auto& node : _path.nodes)
node.moveType = run ? WAYPOINT_MOVE_TYPE_RUN : WAYPOINT_MOVE_TYPE_WALK;
}
void SmartAI::SetDisableGravity(bool fly)
+2 -3
View File
@@ -49,8 +49,8 @@ class TC_GAME_API SmartAI : public CreatureAI
bool IsAIControlled() const;
// Start moving to the desired MovePoint
void StartPath(bool run = false, uint32 pathId = 0, bool repeat = false, Unit* invoker = nullptr, uint32 nodeId = 1);
bool LoadPath(uint32 entry);
void StartPath(uint32 pathId = 0, bool repeat = false, Unit* invoker = nullptr, uint32 nodeId = 1);
WaypointPath const* LoadPath(uint32 entry);
void PausePath(uint32 delay, bool forced = false);
bool CanResumePath();
void StopPath(uint32 DespawnTime = 0, uint32 quest = 0, bool fail = false);
@@ -253,7 +253,6 @@ class TC_GAME_API SmartAI : public CreatureAI
uint32 _escortState;
uint32 _escortNPCFlags;
uint32 _escortInvokerCheckTimer;
WaypointPath _path;
uint32 _currentWaypointNode;
bool _waypointReached;
uint32 _waypointPauseTimer;
@@ -43,6 +43,7 @@
#include "TemporarySummon.h"
#include "Vehicle.h"
#include "WaypointDefines.h"
#include "WaypointManager.h"
SmartScript::SmartScript()
{
@@ -1381,7 +1382,6 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
if (!IsSmart())
break;
bool run = e.action.wpStart.run != 0;
uint32 entry = e.action.wpStart.pathID;
bool repeat = e.action.wpStart.repeat != 0;
@@ -1394,7 +1394,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
}
}
ENSURE_AI(SmartAI, me->AI())->StartPath(run, entry, repeat, unit);
ENSURE_AI(SmartAI, me->AI())->StartPath(entry, repeat, unit);
uint32 quest = e.action.wpStart.quest;
uint32 DespawnTime = e.action.wpStart.despawnTime;
@@ -2062,7 +2062,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
{
for (uint32 pathId : waypoints)
{
WaypointPath const* path = sSmartWaypointMgr->GetPath(pathId);
WaypointPath const* path = sWaypointMgr->GetPath(pathId);
if (!path || path->nodes.empty())
continue;
@@ -2079,7 +2079,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
}
if (closest.first != 0)
ENSURE_AI(SmartAI, creature->AI())->StartPath(false, closest.first, true, nullptr, closest.second);
ENSURE_AI(SmartAI, creature->AI())->StartPath(closest.first, true, nullptr, closest.second);
}
}
}
@@ -34,6 +34,7 @@
#include "UnitDefines.h"
#include "Util.h"
#include "WaypointDefines.h"
#include "WaypointManager.h"
#include <algorithm>
#define TC_SAI_IS_BOOLEAN_VALID(e, value) \
@@ -46,77 +47,6 @@
} \
}
SmartWaypointMgr* SmartWaypointMgr::instance()
{
static SmartWaypointMgr instance;
return &instance;
}
void SmartWaypointMgr::LoadFromDB()
{
uint32 oldMSTime = getMSTime();
_waypointStore.clear();
WorldDatabasePreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_SMARTAI_WP);
PreparedQueryResult result = WorldDatabase.Query(stmt);
if (!result)
{
TC_LOG_INFO("server.loading", ">> Loaded 0 SmartAI Waypoint Paths. DB table `waypoints` is empty.");
return;
}
uint32 count = 0;
uint32 total = 0;
uint32 lastEntry = 0;
uint32 lastId = 1;
do
{
Field* fields = result->Fetch();
uint32 entry = fields[0].GetUInt32();
uint32 id = fields[1].GetUInt32();
float x = fields[2].GetFloat();
float y = fields[3].GetFloat();
float z = fields[4].GetFloat();
Optional<float> o;
if (!fields[5].IsNull())
o = fields[5].GetFloat();
uint32 delay = fields[6].GetUInt32();
if (lastEntry != entry)
{
lastId = 1;
++count;
}
if (lastId != id)
TC_LOG_ERROR("sql.sql", "SmartWaypointMgr::LoadFromDB: Path entry {}, unexpected point id {}, expected {}.", entry, id, lastId);
++lastId;
WaypointPath& path = _waypointStore[entry];
path.id = entry;
path.nodes.emplace_back(id, x, y, z, o, delay);
lastEntry = entry;
++total;
}
while (result->NextRow());
TC_LOG_INFO("server.loading", ">> Loaded {} SmartAI waypoint paths (total {} waypoints) in {} ms", count, total, GetMSTimeDiffToNow(oldMSTime));
}
WaypointPath const* SmartWaypointMgr::GetPath(uint32 id)
{
auto itr = _waypointStore.find(id);
if (itr != _waypointStore.end())
return &itr->second;
return nullptr;
}
SmartAIMgr* SmartAIMgr::instance()
{
static SmartAIMgr instance;
@@ -1901,7 +1831,7 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
break;
case SMART_ACTION_WP_START:
{
WaypointPath const* path = sSmartWaypointMgr->GetPath(e.action.wpStart.pathID);
WaypointPath const* path = sWaypointMgr->GetPath(e.action.wpStart.pathID);
if (!path || path->nodes.empty())
{
TC_LOG_ERROR("sql.sql", "SmartAIMgr: Creature {} Event {} Action {} uses non-existent WaypointPath id {}, skipped.", e.entryOrGuid, e.event_id, e.GetActionType(), e.action.wpStart.pathID);
@@ -865,7 +865,7 @@ struct SmartAction
struct
{
SAIBool run;
SAIBool run; // unused / overridden by waypoint_data
uint32 pathID;
SAIBool repeat;
uint32 quest;
@@ -1687,24 +1687,6 @@ class ObjectGuidVector
};
typedef std::unordered_map<uint32, ObjectGuidVector> ObjectVectorMap;
class TC_GAME_API SmartWaypointMgr
{
public:
static SmartWaypointMgr* instance();
void LoadFromDB();
WaypointPath const* GetPath(uint32 id);
private:
SmartWaypointMgr() { }
~SmartWaypointMgr() { }
std::unordered_map<uint32, WaypointPath> _waypointStore;
};
#define sSmartWaypointMgr SmartWaypointMgr::instance()
// all events for a single entry
typedef std::vector<SmartScriptHolder> SmartAIEventList;
typedef std::vector<SmartScriptHolder> SmartAIEventStoredList;
-3
View File
@@ -2271,9 +2271,6 @@ void World::SetInitialWorldSettings()
TC_LOG_INFO("server.loading", "Loading Waypoints...");
sWaypointMgr->Load();
TC_LOG_INFO("server.loading", "Loading SmartAI Waypoints...");
sSmartWaypointMgr->LoadFromDB();
TC_LOG_INFO("server.loading", "Loading Creature Formations...");
sFormationMgr->LoadCreatureFormations();
@@ -30,7 +30,7 @@ enum Spells
enum Paths
{
GIZRUL_PATH = 402450
GIZRUL_PATH = 3219600
};
enum Events
@@ -36,7 +36,7 @@ enum Misc
{
NEFARIUS_PATH_2 = 1379671,
NEFARIUS_PATH_3 = 1379672,
GYTH_PATH_1 = 1379681,
GYTH_PATH_1 = 11037448,
};
enum Events
@@ -60,11 +60,11 @@ enum Adds
enum Misc
{
NEFARIUS_PATH_1 = 1379670,
NEFARIUS_PATH_2 = 1379671,
NEFARIUS_PATH_3 = 1379672,
REND_PATH_1 = 1379680,
REND_PATH_2 = 1379681,
NEFARIUS_PATH_1 = 11037360,
NEFARIUS_PATH_2 = 11037368,
NEFARIUS_PATH_3 = 11037376,
REND_PATH_1 = 11037440,
REND_PATH_2 = 11037448,
};
/*
@@ -86,8 +86,8 @@ enum Gossip
enum Paths
{
NEFARIUS_PATH_2 = 1379671,
NEFARIUS_PATH_3 = 1379672
NEFARIUS_PATH_2 = 11037368,
NEFARIUS_PATH_3 = 11037376
};
enum GameObjects
@@ -93,7 +93,7 @@ enum MTInstanceText
enum MTMovementData
{
PATH_KALECGOS_FLIGHT = 248440
PATH_KALECGOS_FLIGHT = 1987520
};
template <class AI, class T>
@@ -261,7 +261,7 @@ struct npc_koltira_deathweaver : public ScriptedAI
me->SetWalk(false);
me->SetImmuneToNPC(false);
DoCastSelf(SPELL_HERO_AGGRO);
me->GetMotionMaster()->MovePath(NPC_KOLTIRA, false);
me->GetMotionMaster()->MovePath(NPC_KOLTIRA << 3, false);
break;
case EVENT_CHECK_PLAYER:
@@ -64,7 +64,7 @@ enum Misc
{
WEAPON_KIRTONOS_STAFF = 11365,
POINT_KIRTONOS_LAND = 13,
KIRTONOS_PATH = 105061
KIRTONOS_PATH = 840488
};
Position const PosMove[2] =
@@ -25,11 +25,11 @@
enum COG_Paths
{
STORMWIND_PATH = 80500,
GOLDSHIRE_PATH = 80501,
WOODS_PATH = 80502,
HOUSE_PATH = 80503,
LISA_PATH = 80700
STORMWIND_PATH = 644000,
GOLDSHIRE_PATH = 644008,
WOODS_PATH = 644016,
HOUSE_PATH = 644024,
LISA_PATH = 645600
};
enum COG_Waypoints
@@ -27,8 +27,8 @@ enum Partygoer_Pather
EVENT_REMOVE_EQUIPMENT_PATHER,
EVENT_STOP_DANCING_PATHER,
PATH_FIRST_PATH = 594440,
PATH_LAST_PATH = 594444,
PATH_FIRST_PATH = 4755520,
PATH_LAST_PATH = 4755552,
};
struct npc_partygoer_pather : public ScriptedAI
@@ -60,12 +60,12 @@ enum HordeHauler
TALK_ON_SEPULCHER = 2,
TALK_ON_FORSAKEN_FRONT = 3,
PATH_FROM_NORTH_TO_SOUTH = 447310,
PATH_TROOPER_1 = 447320,
PATH_TROOPER_2 = 447321,
PATH_TROOPER_3 = 447322,
PATH_TROOPER_4 = 447323,
PATH_TROOPER_5 = 447324,
PATH_FROM_NORTH_TO_SOUTH = 3578480,
PATH_TROOPER_1 = 3578560,
PATH_TROOPER_2 = 3578568,
PATH_TROOPER_3 = 3578576,
PATH_TROOPER_4 = 3578584,
PATH_TROOPER_5 = 3578592,
WAYPOINT_ON_FORSAKEN_HIGH = 11,
WAYPOINT_ON_SEPULCHER = 35,
@@ -340,8 +340,8 @@ enum QuestTheWarchiefCometh
TALK_CROMUSH_COMETH_0 = 0,
TALK_CROMUSH_COMETH_1 = 1,
PATH_CROMUSH = 446402,
PATH_GARROSH = 446290,
PATH_CROMUSH = 3571216,
PATH_GARROSH = 3570320,
POINT_AGATHA_PRE_RISE = 1,
POINT_AGATHA_RISE = 2,
@@ -1417,9 +1417,9 @@ enum ForsakenBat
TALK_BAT_ARRIVED_TO_ISLE = 0,
TALK_BAT_GOING_HOME = 1,
PATH_BAT_TO_LAKE = 448210,
PATH_BAT_AROUND_LAKE = 448211,
PATH_BAT_TO_HOME = 448212,
PATH_BAT_TO_LAKE = 3585680,
PATH_BAT_AROUND_LAKE = 3585688,
PATH_BAT_TO_HOME = 3585696,
WAYPOINT_LAST_POINT_TO_LAKE = 8,
WAYPOINT_LAST_POINT_AROUND_LAKE = 32,
@@ -1660,8 +1660,8 @@ enum DeathstalkerRaneYorick
TALK_YORICK_EXSANGUINATE_SUMMON = 0,
TALK_YORICK_EXSANGUINATE_HIDE = 1,
PATH_YORICK_UP = 448820,
PATH_YORICK_HIDE = 448821,
PATH_YORICK_UP = 3590560,
PATH_YORICK_HIDE = 3590568,
WAYPOINT_CLOSE_TO_ARMOIRE = 15,
WAYPOINT_HIDDEN_NEXT_TO_ARMOIRE = 2
@@ -1909,12 +1909,12 @@ enum WaitingToExsanguinate
TALK_BLOODFANG_EXSANGUINATE_9 = 9,
TALK_BLOODFANG_EXSANGUINATE_10 = 10,
PATH_CROWLEY_ENTER = 448830,
PATH_BLOODFANG_ENTER = 448840,
PATH_BLOODFANG_NEAR_YORICK = 448841,
PATH_BLOODFANG_WITH_YORICK = 448842,
PATH_BLOODFANG_EXIT = 448843,
PATH_CROWLEY_EXIT = 448831
PATH_CROWLEY_ENTER = 3590640,
PATH_BLOODFANG_ENTER = 3590720,
PATH_BLOODFANG_NEAR_YORICK = 3590728,
PATH_BLOODFANG_WITH_YORICK = 3590736,
PATH_BLOODFANG_EXIT = 3590744,
PATH_CROWLEY_EXIT = 3590648
};
// 44893 - Armoire
@@ -4140,7 +4140,7 @@ enum AgathaFenrisIsle
TALK_AGATHA_POST_EVENT1 = 3,
TALK_AGATHA_POST_EVENT2 = 4,
PATH_AGATHA_TO_FORSAKEN = 449510,
PATH_AGATHA_TO_FORSAKEN = 3596080,
WAYPOINT_SPEED_UP = 14,
WAYPOINT_ARRIVED_TO_FORSAKEN = 19,
@@ -57,7 +57,7 @@ enum Belnistrasz
EVENT_FIREBALL = 5,
EVENT_FROST_NOVA = 6,
PATH_ESCORT = 871710,
PATH_ESCORT = 6973680,
POINT_REACH_IDOL = 17,
QUEST_EXTINGUISHING_THE_IDOL = 3525,
@@ -29,7 +29,7 @@ enum Misc
NPC_GAHZRILLA = 7273,
// Paths
PATH_ADDS = 81553
PATH_ADDS = 652424
};
int const pyramidSpawnTotal = 54;
@@ -342,7 +342,7 @@ struct npc_crystal_channel_target : public ScriptedAI
}
if (summon)
summon->GetMotionMaster()->MovePath(summon->GetEntry() * 100, false);
summon->GetMotionMaster()->MovePath((summon->GetEntry() * 100) << 3, false);
if (_spell == SPELL_SUMMON_CRYSTAL_HANDLER)
Reset();
@@ -379,7 +379,7 @@ struct npc_highlord_tirion_fordring_lh : public ScriptedAI
case EVENT_MURADIN_RUN:
case EVENT_SAURFANG_RUN:
if (Creature* factionNPC = ObjectAccessor::GetCreature(*me, _factionNPC))
factionNPC->GetMotionMaster()->MovePath(factionNPC->GetSpawnId() * 10, false);
factionNPC->GetMotionMaster()->MovePath((factionNPC->GetSpawnId() * 10) << 3, false);
me->setActive(false);
_damnedKills = 3;
break;
@@ -175,7 +175,7 @@ enum EnslavedProtoDrake
TYPE_PROTODRAKE_AT = 28,
DATA_PROTODRAKE_MOVE = 6,
PATH_PROTODRAKE = 125946,
PATH_PROTODRAKE = 1007568,
EVENT_REND = 1,
EVENT_FLAME_BREATH = 2,
@@ -769,11 +769,11 @@ enum Thassarian
SAY_LERYSSA_3 = 2,
SAY_LERYSSA_4 = 3,
PATH_THASSARIAN = 1013030,
PATH_ARTHAS = 1013031,
PATH_TALBOT = 1013032,
PATH_ARLOS = 1013033,
PATH_LERYSSA = 1013034
PATH_THASSARIAN = 8104240,
PATH_ARTHAS = 8104248,
PATH_TALBOT = 8104256,
PATH_ARLOS = 8104264,
PATH_LERYSSA = 8104272
};
struct npc_thassarian : public ScriptedAI
@@ -152,7 +152,7 @@ struct npc_freed_protodrake : public VehicleAI
if (Unit* passenger = vehicle->GetPassenger(0))
{
Talk(TEXT_EMOTE, passenger);
me->GetMotionMaster()->MovePath(NPC_DRAKE, false);
me->GetMotionMaster()->MovePath(NPC_DRAKE << 3, false);
}
}
else
@@ -430,7 +430,7 @@ private:
enum WildWyrm
{
PATH_WILD_WYRM = 30275 * 10,
PATH_WILD_WYRM = (30275 * 10) << 3,
// Phase 1
SPELL_PLAYER_MOUNT_WYRM = 56672,
@@ -725,8 +725,8 @@ enum JokkumScriptcast
{
NPC_KINGJOKKUM = 30331,
NPC_THORIM = 30390,
PATH_JOKKUM = 2072200,
PATH_JOKKUM_END = 2072201,
PATH_JOKKUM = 16577600,
PATH_JOKKUM_END = 16577608,
SAY_HOLD_ON = 0,
SAY_JOKKUM_1 = 1,
SAY_JOKKUM_2 = 2,
@@ -367,14 +367,14 @@ public:
stormforgedMonitor->SetWalk(false);
/// The npc would search an alternative way to get to the last waypoint without this unit state.
stormforgedMonitor->AddUnitState(UNIT_STATE_IGNORE_PATHFINDING);
stormforgedMonitor->GetMotionMaster()->MovePath(NPC_STORMFORGED_MONITOR * 100, false);
stormforgedMonitor->GetMotionMaster()->MovePath((NPC_STORMFORGED_MONITOR * 100) << 3, false);
}
stormforgedEradictor = player->SummonCreature(NPC_STORMFORGED_ERADICTOR, stormforgedEradictorPosition, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 1min);
if (stormforgedEradictor)
{
stormforgedEradictorGUID = stormforgedEradictor->GetGUID();
stormforgedEradictor->GetMotionMaster()->MovePath(NPC_STORMFORGED_ERADICTOR * 100, false);
stormforgedEradictor->GetMotionMaster()->MovePath((NPC_STORMFORGED_ERADICTOR * 100) << 3, false);
}
return true;