aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorModoX <moardox@gmail.com>2023-04-08 01:33:05 +0200
committerShauren <shauren.trinity@gmail.com>2025-11-15 22:27:11 +0100
commit91dcae540ea8c7ecfe5794b9020fe93173b42102 (patch)
tree36f15b7e53f908e63dd58e9e6b7533aa93d82bd7
parentec6d3708591163b1875f969964be3fd7cb9a517b (diff)
Core/SAI: Drop waypoints table and move existing rows to waypoint_data table (#28834)
(cherry picked from commit 356c98579babd1aef12e2b5ef28baba2403368d0)
-rw-r--r--sql/updates/world/3.3.5/2025_11_15_00_world_2023_04_08_00_world.sql28
-rw-r--r--src/server/database/Database/Implementation/WorldDatabase.cpp1
-rw-r--r--src/server/database/Database/Implementation/WorldDatabase.h1
-rw-r--r--src/server/game/AI/SmartScripts/SmartAI.cpp47
-rw-r--r--src/server/game/AI/SmartScripts/SmartAI.h5
-rw-r--r--src/server/game/AI/SmartScripts/SmartScript.cpp8
-rw-r--r--src/server/game/AI/SmartScripts/SmartScriptMgr.cpp74
-rw-r--r--src/server/game/AI/SmartScripts/SmartScriptMgr.h20
-rw-r--r--src/server/game/World/World.cpp3
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_gizrul_the_slavener.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_gyth.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_rend_blackhand.cpp10
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_the_beast.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_nefarian.cpp4
-rw-r--r--src/server/scripts/EasternKingdoms/MagistersTerrace/magisters_terrace.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp6
-rw-r--r--src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/zone_elwynn_forest.cpp10
-rw-r--r--src/server/scripts/EasternKingdoms/zone_eversong_woods.cpp4
-rw-r--r--src/server/scripts/Kalimdor/RazorfenDowns/razorfen_downs.cpp2
-rw-r--r--src/server/scripts/Kalimdor/ZulFarrak/instance_zulfarrak.cpp2
-rw-r--r--src/server/scripts/Kalimdor/zone_azshara.cpp2
-rw-r--r--src/server/scripts/Kalimdor/zone_orgrimmar.cpp6
-rw-r--r--src/server/scripts/Northrend/DraktharonKeep/boss_novos.cpp2
-rw-r--r--src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp2
-rw-r--r--src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/utgarde_keep.cpp2
-rw-r--r--src/server/scripts/Northrend/zone_borean_tundra.cpp10
-rw-r--r--src/server/scripts/Northrend/zone_storm_peaks.cpp8
-rw-r--r--src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_broggok.cpp2
-rw-r--r--src/server/scripts/World/areatrigger_scripts.cpp4
31 files changed, 98 insertions, 177 deletions
diff --git a/sql/updates/world/3.3.5/2025_11_15_00_world_2023_04_08_00_world.sql b/sql/updates/world/3.3.5/2025_11_15_00_world_2023_04_08_00_world.sql
new file mode 100644
index 00000000000..de728abc6f1
--- /dev/null
+++ b/sql/updates/world/3.3.5/2025_11_15_00_world_2023_04_08_00_world.sql
@@ -0,0 +1,28 @@
+-- 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 `event_param2`=((`event_param2` << 3) | 1) WHERE `event_type` IN(40, 55, 56, 57, 58) AND `event_param2` > 0;
+
+DROP TABLE IF EXISTS `waypoints`;
diff --git a/src/server/database/Database/Implementation/WorldDatabase.cpp b/src/server/database/Database/Implementation/WorldDatabase.cpp
index 9f866ebf8d6..b0b6580ddab 100644
--- a/src/server/database/Database/Implementation/WorldDatabase.cpp
+++ b/src/server/database/Database/Implementation/WorldDatabase.cpp
@@ -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, 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, action_type, action_param1, action_param2, action_param3, action_param4, action_param5, action_param6, 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);
diff --git a/src/server/database/Database/Implementation/WorldDatabase.h b/src/server/database/Database/Implementation/WorldDatabase.h
index d1b865aa9bf..7f7db1df651 100644
--- a/src/server/database/Database/Implementation/WorldDatabase.h
+++ b/src/server/database/Database/Implementation/WorldDatabase.h
@@ -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,
diff --git a/src/server/game/AI/SmartScripts/SmartAI.cpp b/src/server/game/AI/SmartScripts/SmartAI.cpp
index dc5710e1094..458f5115309 100644
--- a/src/server/game/AI/SmartScripts/SmartAI.cpp
+++ b/src/server/game/AI/SmartScripts/SmartAI.cpp
@@ -29,6 +29,7 @@
#include "ScriptMgr.h"
#include "SpellAuras.h"
#include "Vehicle.h"
+#include "WaypointManager.h"
SmartAI::SmartAI(Creature* creature) : CreatureAI(creature), _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),
@@ -43,20 +44,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)
- {
- if (!LoadPath(pathId))
- return;
- }
+ if (!pathId)
+ return;
- if (_path.nodes.empty())
+ WaypointPath const* path = LoadPath(pathId);
+ if (!path)
return;
_currentWaypointNode = nodeId;
@@ -73,32 +70,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(pathId, _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)
@@ -189,7 +177,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)
@@ -251,7 +239,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);
@@ -713,7 +702,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);
@@ -761,8 +750,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)
diff --git a/src/server/game/AI/SmartScripts/SmartAI.h b/src/server/game/AI/SmartScripts/SmartAI.h
index bc7339e4c59..fa2fbb38171 100644
--- a/src/server/game/AI/SmartScripts/SmartAI.h
+++ b/src/server/game/AI/SmartScripts/SmartAI.h
@@ -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);
@@ -263,7 +263,6 @@ class TC_GAME_API SmartAI : public CreatureAI
uint32 _escortState;
uint32 _escortNPCFlags;
uint32 _escortInvokerCheckTimer;
- WaypointPath _path;
uint32 _currentWaypointNode;
bool _waypointReached;
uint32 _waypointPauseTimer;
diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp
index 2709ba65e2d..9aa10aa893f 100644
--- a/src/server/game/AI/SmartScripts/SmartScript.cpp
+++ b/src/server/game/AI/SmartScripts/SmartScript.cpp
@@ -41,6 +41,7 @@
#include "TemporarySummon.h"
#include "Vehicle.h"
#include "WaypointDefines.h"
+#include "WaypointManager.h"
#include <G3D/Quat.h>
SmartScript::SmartScript()
@@ -1363,7 +1364,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;
@@ -1376,7 +1376,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;
@@ -2008,7 +2008,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;
@@ -2025,7 +2025,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);
}
}
}
diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp
index 9f730136c33..f155a1cec75 100644
--- a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp
+++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp
@@ -31,6 +31,7 @@
#include "UnitDefines.h"
#include "Unit.h"
#include "WaypointDefines.h"
+#include "WaypointManager.h"
#define TC_SAI_IS_BOOLEAN_VALID(e, value) \
{ \
@@ -42,77 +43,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;
@@ -1756,7 +1686,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);
diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.h b/src/server/game/AI/SmartScripts/SmartScriptMgr.h
index 52204eab64e..e319ab05d85 100644
--- a/src/server/game/AI/SmartScripts/SmartScriptMgr.h
+++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.h
@@ -864,7 +864,7 @@ struct SmartAction
struct
{
- SAIBool run;
+ SAIBool run; // unused / overridden by waypoint_data
uint32 pathID;
SAIBool repeat;
uint32 quest;
@@ -1646,24 +1646,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;
diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp
index f24237bc643..d51323a0672 100644
--- a/src/server/game/World/World.cpp
+++ b/src/server/game/World/World.cpp
@@ -2043,9 +2043,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();
diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_gizrul_the_slavener.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_gizrul_the_slavener.cpp
index 877d4dc23b7..26da4e9054d 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_gizrul_the_slavener.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_gizrul_the_slavener.cpp
@@ -30,7 +30,7 @@ enum Spells
enum Paths
{
- GIZRUL_PATH = 402450
+ GIZRUL_PATH = 3219600
};
enum Events
diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_gyth.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_gyth.cpp
index 1de8cfcd416..ad3f9a32ddc 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_gyth.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_gyth.cpp
@@ -36,7 +36,7 @@ enum Misc
{
NEFARIUS_PATH_2 = 1379671,
NEFARIUS_PATH_3 = 1379672,
- GYTH_PATH_1 = 1379681,
+ GYTH_PATH_1 = 11037448,
};
enum Events
diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_rend_blackhand.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_rend_blackhand.cpp
index e2cb6e5d13f..905140b967e 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_rend_blackhand.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_rend_blackhand.cpp
@@ -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,
};
/*
diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_the_beast.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_the_beast.cpp
index 0b4894fc81a..cd12ccdfcb7 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_the_beast.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_the_beast.cpp
@@ -50,7 +50,7 @@ enum BeastMisc
{
DATA_BEAST_REACHED = 1,
DATA_BEAST_ROOM = 2,
- BEAST_MOVEMENT_ID = 1379690,
+ BEAST_MOVEMENT_ID = 11037520,
NPC_BLACKHAND_ELITE = 10317,
diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_nefarian.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_nefarian.cpp
index 193fd6ad699..49d164fe866 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_nefarian.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_nefarian.cpp
@@ -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
diff --git a/src/server/scripts/EasternKingdoms/MagistersTerrace/magisters_terrace.cpp b/src/server/scripts/EasternKingdoms/MagistersTerrace/magisters_terrace.cpp
index f2e62a21aa4..113e0939fde 100644
--- a/src/server/scripts/EasternKingdoms/MagistersTerrace/magisters_terrace.cpp
+++ b/src/server/scripts/EasternKingdoms/MagistersTerrace/magisters_terrace.cpp
@@ -34,7 +34,7 @@ enum KalecgosMisc
SPELL_TRANSFORM_VISUAL = 24085,
SPELL_ORB_KILL_CREDIT = 46307,
- PATH_KALECGOS_FLIGHT = 248440,
+ PATH_KALECGOS_FLIGHT = 1987520,
POINT_ID_PREPARE_LANDING = 6,
EVENT_KALECGOS_LANDING = 1,
diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp
index cba23ee98e0..15143776039 100644
--- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp
+++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp
@@ -261,7 +261,7 @@ struct npc_koltira_deathweaver : public ScriptedAI
me->SetWalk(false);
me->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_NPC);
DoCastSelf(SPELL_HERO_AGGRO);
- me->GetMotionMaster()->MovePath(NPC_KOLTIRA, false);
+ me->GetMotionMaster()->MovePath(NPC_KOLTIRA << 3, false);
break;
case EVENT_CHECK_PLAYER:
diff --git a/src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp b/src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp
index ec37f0388ac..52631cc2b2a 100644
--- a/src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp
+++ b/src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp
@@ -168,9 +168,9 @@ enum Events
enum Waypoints
{
- HARRISON_MOVE_1 = 860440,
- HARRISON_MOVE_2 = 860441,
- HARRISON_MOVE_3 = 860442
+ HARRISON_MOVE_1 = 6883520,
+ HARRISON_MOVE_2 = 6883528,
+ HARRISON_MOVE_3 = 6883536
};
enum DisplayIds
diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp
index ef5189f2eb5..85815b33933 100644
--- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp
+++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp
@@ -64,7 +64,7 @@ enum Events
enum Misc
{
MODEL_OHGAN_MOUNT = 15271,
- PATH_MANDOKIR = 492861,
+ PATH_MANDOKIR = 3942888,
POINT_MANDOKIR_END = 24,
CHAINED_SPIRT_COUNT = 20
};
diff --git a/src/server/scripts/EasternKingdoms/zone_elwynn_forest.cpp b/src/server/scripts/EasternKingdoms/zone_elwynn_forest.cpp
index afb6083047e..63901714a4e 100644
--- a/src/server/scripts/EasternKingdoms/zone_elwynn_forest.cpp
+++ b/src/server/scripts/EasternKingdoms/zone_elwynn_forest.cpp
@@ -27,11 +27,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
diff --git a/src/server/scripts/EasternKingdoms/zone_eversong_woods.cpp b/src/server/scripts/EasternKingdoms/zone_eversong_woods.cpp
index ac982ea88b5..0c52922b0a1 100644
--- a/src/server/scripts/EasternKingdoms/zone_eversong_woods.cpp
+++ b/src/server/scripts/EasternKingdoms/zone_eversong_woods.cpp
@@ -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
diff --git a/src/server/scripts/Kalimdor/RazorfenDowns/razorfen_downs.cpp b/src/server/scripts/Kalimdor/RazorfenDowns/razorfen_downs.cpp
index ccf78432e41..f7f0a414a1c 100644
--- a/src/server/scripts/Kalimdor/RazorfenDowns/razorfen_downs.cpp
+++ b/src/server/scripts/Kalimdor/RazorfenDowns/razorfen_downs.cpp
@@ -58,7 +58,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,
diff --git a/src/server/scripts/Kalimdor/ZulFarrak/instance_zulfarrak.cpp b/src/server/scripts/Kalimdor/ZulFarrak/instance_zulfarrak.cpp
index 7a0df1330f2..3fe46931b3f 100644
--- a/src/server/scripts/Kalimdor/ZulFarrak/instance_zulfarrak.cpp
+++ b/src/server/scripts/Kalimdor/ZulFarrak/instance_zulfarrak.cpp
@@ -30,7 +30,7 @@ enum Misc
NPC_GAHZRILLA = 7273,
// Paths
- PATH_ADDS = 81553
+ PATH_ADDS = 652424
};
int const pyramidSpawnTotal = 54;
diff --git a/src/server/scripts/Kalimdor/zone_azshara.cpp b/src/server/scripts/Kalimdor/zone_azshara.cpp
index 8d00863ac70..851a420818a 100644
--- a/src/server/scripts/Kalimdor/zone_azshara.cpp
+++ b/src/server/scripts/Kalimdor/zone_azshara.cpp
@@ -49,7 +49,7 @@ enum RizzleSprysprocketData
GOSSIP_MENU_GET_MOONSTONE = 57025,
GOSSIP_OPTION_GET_MOONSTONE = 0,
- PATH_RIZZLE = 2300200
+ PATH_RIZZLE = 18401600
};
struct npc_rizzle_sprysprocket : public ScriptedAI
diff --git a/src/server/scripts/Kalimdor/zone_orgrimmar.cpp b/src/server/scripts/Kalimdor/zone_orgrimmar.cpp
index 5ad228974b7..e6a36402f52 100644
--- a/src/server/scripts/Kalimdor/zone_orgrimmar.cpp
+++ b/src/server/scripts/Kalimdor/zone_orgrimmar.cpp
@@ -351,7 +351,7 @@ public:
void Reset() override
{
inProgress = false;
- me->GetMotionMaster()->MovePath(me->GetSpawnId() * 10, true);
+ me->GetMotionMaster()->MovePath((me->GetSpawnId() * 10) << 3, true);
events.Reset();
}
@@ -613,7 +613,7 @@ public:
void Reset() override
{
events.Reset();
- me->GetMotionMaster()->MovePath(me->GetSpawnId() * 10, true);
+ me->GetMotionMaster()->MovePath((me->GetSpawnId() * 10) << 3, true);
sceneInProgress = false;
if (!spawnedGuards)
@@ -633,7 +633,7 @@ public:
return;
if (pointId == 2)
- me->GetMotionMaster()->MovePath(me->GetSpawnId() * 10, true);
+ me->GetMotionMaster()->MovePath((me->GetSpawnId() * 10) << 3, true);
}
void DoAction(int32 actionId) override
diff --git a/src/server/scripts/Northrend/DraktharonKeep/boss_novos.cpp b/src/server/scripts/Northrend/DraktharonKeep/boss_novos.cpp
index 88234f4a7fe..cfd61e41343 100644
--- a/src/server/scripts/Northrend/DraktharonKeep/boss_novos.cpp
+++ b/src/server/scripts/Northrend/DraktharonKeep/boss_novos.cpp
@@ -346,7 +346,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();
diff --git a/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp b/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp
index 490d57514cc..f8db1d79a6b 100644
--- a/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp
+++ b/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp
@@ -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;
diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/utgarde_keep.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/utgarde_keep.cpp
index 9da294462c8..076500690c2 100644
--- a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/utgarde_keep.cpp
+++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/utgarde_keep.cpp
@@ -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,
diff --git a/src/server/scripts/Northrend/zone_borean_tundra.cpp b/src/server/scripts/Northrend/zone_borean_tundra.cpp
index 2142d6b8577..2f3f572dca6 100644
--- a/src/server/scripts/Northrend/zone_borean_tundra.cpp
+++ b/src/server/scripts/Northrend/zone_borean_tundra.cpp
@@ -768,11 +768,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
diff --git a/src/server/scripts/Northrend/zone_storm_peaks.cpp b/src/server/scripts/Northrend/zone_storm_peaks.cpp
index f3f65476cab..fb1cbe919f0 100644
--- a/src/server/scripts/Northrend/zone_storm_peaks.cpp
+++ b/src/server/scripts/Northrend/zone_storm_peaks.cpp
@@ -173,7 +173,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
@@ -451,7 +451,7 @@ private:
enum WildWyrm
{
- PATH_WILD_WYRM = 30275 * 10,
+ PATH_WILD_WYRM = (30275 * 10) << 3,
// Phase 1
SPELL_PLAYER_MOUNT_WYRM = 56672,
@@ -746,8 +746,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,
diff --git a/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_broggok.cpp b/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_broggok.cpp
index b8b794d20cc..6d286cb4bc5 100644
--- a/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_broggok.cpp
+++ b/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_broggok.cpp
@@ -66,7 +66,7 @@ enum BroggokEvents
enum BroggokMisc
{
- PATH_ROOM = 1381150,
+ PATH_ROOM = 11049200,
NPC_BROGGOK_POISON_CLOUD = 17662,
NPC_INCOMBAT_TRIGGER = 16006
};
diff --git a/src/server/scripts/World/areatrigger_scripts.cpp b/src/server/scripts/World/areatrigger_scripts.cpp
index 02517d954c5..6b197f612c3 100644
--- a/src/server/scripts/World/areatrigger_scripts.cpp
+++ b/src/server/scripts/World/areatrigger_scripts.cpp
@@ -397,14 +397,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;