From e3f4cba090f059dfbafb202e9c92387022f3b61c Mon Sep 17 00:00:00 2001 From: blinkysc <37940565+blinkysc@users.noreply.github.com> Date: Sat, 25 Oct 2025 16:00:50 -0500 Subject: [PATCH 01/28] fix(HoS/SmartAI): Raging Construct uses correct Potent Jolt timings (#23409) Co-authored-by: John Doe --- .../updates/pending_db_world/rev_1761416930708862922.sql | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 data/sql/updates/pending_db_world/rev_1761416930708862922.sql diff --git a/data/sql/updates/pending_db_world/rev_1761416930708862922.sql b/data/sql/updates/pending_db_world/rev_1761416930708862922.sql new file mode 100644 index 000000000..b9b360dcf --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1761416930708862922.sql @@ -0,0 +1,7 @@ +-- +UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = 27970; +DELETE FROM `smart_scripts` WHERE (`source_type` = 0 AND `entryorguid` = 27970); +INSERT INTO `smart_scripts` (`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_param6`, `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`, `comment`) VALUES +(27970, 0, 0, 0, 0, 0, 100, 2, 3000, 9000, 16000, 16000, 0, 0, 11, 51819, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Raging Construct - In Combat - Cast \'Potent Jolt\' (Normal Dungeon)'), +(27970, 0, 1, 0, 0, 0, 100, 4, 3000, 9000, 16000, 16000, 0, 0, 11, 61514, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Raging Construct - In Combat - Cast \'Potent Jolt\' (Heroic Dungeon)'), +(27970, 0, 2, 0, 0, 0, 100, 6, 4000, 7000, 9000, 12000, 0, 0, 11, 28168, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Raging Construct - In Combat - Cast \'Arcing Smash\' (Dungeon)'); From dfd21be75b0de70b2a5d29920a780abbb0e00255 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sat, 25 Oct 2025 21:17:10 +0000 Subject: [PATCH 02/28] chore(DB): import pending files Referenced commit(s): e3f4cba090f059dfbafb202e9c92387022f3b61c --- .../rev_1761416930708862922.sql => db_world/2025_10_25_01.sql} | 1 + 1 file changed, 1 insertion(+) rename data/sql/updates/{pending_db_world/rev_1761416930708862922.sql => db_world/2025_10_25_01.sql} (96%) diff --git a/data/sql/updates/pending_db_world/rev_1761416930708862922.sql b/data/sql/updates/db_world/2025_10_25_01.sql similarity index 96% rename from data/sql/updates/pending_db_world/rev_1761416930708862922.sql rename to data/sql/updates/db_world/2025_10_25_01.sql index b9b360dcf..d60b3659d 100644 --- a/data/sql/updates/pending_db_world/rev_1761416930708862922.sql +++ b/data/sql/updates/db_world/2025_10_25_01.sql @@ -1,3 +1,4 @@ +-- DB update 2025_10_25_00 -> 2025_10_25_01 -- UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = 27970; DELETE FROM `smart_scripts` WHERE (`source_type` = 0 AND `entryorguid` = 27970); From 1b2db00701f97d9e32793cff9bd8138ae385b35f Mon Sep 17 00:00:00 2001 From: killerwife Date: Sun, 26 Oct 2025 02:25:43 +0100 Subject: [PATCH 03/28] fix(Core/Vehicle): Fix invisible vehicle passengers (#23406) --- src/server/game/Entities/Player/Player.cpp | 2 + src/server/game/Entities/Player/Player.h | 5 ++ src/server/game/Entities/Unit/Unit.cpp | 3 + src/server/game/Entities/Vehicle/Vehicle.cpp | 4 +- src/server/game/Handlers/MovementHandler.cpp | 18 ++++- src/server/game/Handlers/TaxiHandler.cpp | 82 ++++++++++++-------- src/server/game/Movement/Spline/MoveSpline.h | 1 + 7 files changed, 77 insertions(+), 38 deletions(-) diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index beb0bc431..9e481658b 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -417,6 +417,8 @@ Player::Player(WorldSession* session): Unit(), m_mover(this) GetObjectVisibilityContainer().InitForPlayer(); sScriptMgr->OnConstructPlayer(this); + + m_expectingChangeTransport = false; } Player::~Player() diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index 11bb75df4..b7e35ca53 100644 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -2633,6 +2633,9 @@ public: std::string GetDebugInfo() const override; + bool IsExpectingChangeTransport() const { return m_expectingChangeTransport; } + void SetExpectingChangeTransport(bool state) { m_expectingChangeTransport = state; } + /*********************************************************/ /*** SPELL QUEUE SYSTEM ***/ /*********************************************************/ @@ -3013,6 +3016,8 @@ private: PlayerSettingMap m_charSettingsMap; Seconds m_creationTime; + + bool m_expectingChangeTransport; }; void AddItemsSetItem(Player* player, Item* item); diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 4c9d6b60c..7bd1f97f8 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -19542,6 +19542,9 @@ void Unit::_ExitVehicle(Position const* exitPosition) if (!vehicleBase) return; + if (IsPlayer()) + ToPlayer()->SetExpectingChangeTransport(true); + SetControlled(false, UNIT_STATE_ROOT); // SMSG_MOVE_FORCE_UNROOT, ~MOVEMENTFLAG_ROOT Position pos; diff --git a/src/server/game/Entities/Vehicle/Vehicle.cpp b/src/server/game/Entities/Vehicle/Vehicle.cpp index b0752ecd2..65ef2bdec 100644 --- a/src/server/game/Entities/Vehicle/Vehicle.cpp +++ b/src/server/game/Entities/Vehicle/Vehicle.cpp @@ -423,7 +423,9 @@ bool Vehicle::AddPassenger(Unit* unit, int8 seatId) if (_me->IsInWorld()) { unit->SendClearTarget(); // SMSG_BREAK_TARGET - unit->SetControlled(true, UNIT_STATE_ROOT); // SMSG_FORCE_ROOT - In some cases we send SMSG_SPLINE_MOVE_ROOT here (for creatures) + unit->SetControlled(true, UNIT_STATE_ROOT); // SMSG_FORCE_ROOT - In some cases we send SMSG_SPLINE_MOVE_ROOT here (for creatures) + if (unit->IsPlayer()) + unit->ToPlayer()->SetExpectingChangeTransport(true); // also adds MOVEMENTFLAG_ROOT Movement::MoveSplineInit init(unit); init.DisableTransportPathTransformations(); diff --git a/src/server/game/Handlers/MovementHandler.cpp b/src/server/game/Handlers/MovementHandler.cpp index 537756706..66aa1b590 100644 --- a/src/server/game/Handlers/MovementHandler.cpp +++ b/src/server/game/Handlers/MovementHandler.cpp @@ -376,6 +376,9 @@ void WorldSession::HandleMovementOpcodes(WorldPacket& recvData) return; } + if (opcode == CMSG_MOVE_FALL_RESET || opcode == CMSG_MOVE_CHNG_TRANSPORT) + return; + /* process position-change */ WorldPacket data(opcode, recvData.size()); WriteMovementInfo(&data, &movementInfo); @@ -516,7 +519,10 @@ bool WorldSession::VerifyMovementInfo(MovementInfo const& movementInfo, Player* } if (!mover->movespline->Finalized()) - return false; + { + if (!mover->movespline->isBoarding() || (opcode != CMSG_FORCE_MOVE_UNROOT_ACK && opcode != CMSG_FORCE_MOVE_ROOT_ACK)) + return false; + } // Xinef: do not allow to move with UNIT_FLAG_DISABLE_MOVE if (mover->HasUnitFlag(UNIT_FLAG_DISABLE_MOVE)) @@ -958,7 +964,8 @@ void WorldSession::ComputeNewClockDelta() void WorldSession::HandleMoveRootAck(WorldPacket& recvData) { - LOG_DEBUG("network", "WORLD: {}", GetOpcodeNameForLogging((Opcodes)recvData.GetOpcode())); + Opcodes opcode = (Opcodes)recvData.GetOpcode(); + LOG_DEBUG("network", "WORLD: {}", GetOpcodeNameForLogging(opcode)); ObjectGuid guid; uint32 counter; @@ -973,7 +980,7 @@ void WorldSession::HandleMoveRootAck(WorldPacket& recvData) if (mover->GetGUID() != guid) return; - if (recvData.GetOpcode() == CMSG_FORCE_MOVE_UNROOT_ACK) // unroot case + if (opcode == CMSG_FORCE_MOVE_UNROOT_ACK) // unroot case { if (!mover->m_movementInfo.HasMovementFlag(MOVEMENTFLAG_ROOT)) return; @@ -987,7 +994,10 @@ void WorldSession::HandleMoveRootAck(WorldPacket& recvData) if (!ProcessMovementInfo(movementInfo, mover, _player, recvData)) return; - WorldPacket data(recvData.GetOpcode() == CMSG_FORCE_MOVE_UNROOT_ACK ? MSG_MOVE_UNROOT : MSG_MOVE_ROOT); + if (_player->IsExpectingChangeTransport()) + return; + + WorldPacket data(opcode == CMSG_FORCE_MOVE_UNROOT_ACK ? MSG_MOVE_UNROOT : MSG_MOVE_ROOT); WriteMovementInfo(&data, &movementInfo); mover->SendMessageToSet(&data, _player); } diff --git a/src/server/game/Handlers/TaxiHandler.cpp b/src/server/game/Handlers/TaxiHandler.cpp index 8a76a2bd6..03a5ba89c 100644 --- a/src/server/game/Handlers/TaxiHandler.cpp +++ b/src/server/game/Handlers/TaxiHandler.cpp @@ -198,54 +198,70 @@ void WorldSession::HandleActivateTaxiExpressOpcode(WorldPacket& recvData) void WorldSession::HandleMoveSplineDoneOpcode(WorldPacket& recvData) { - ObjectGuid guid; // used only for proper packet read + ObjectGuid guid; // used only for proper packet read + MovementInfo movementInfo; // used only for proper packet read + uint32 movementCounter; // spline counter + + Unit* mover = _player->m_mover; + recvData >> guid.ReadAsPacked(); - - MovementInfo movementInfo; // used only for proper packet read - movementInfo.guid = guid; ReadMovementInfo(recvData, &movementInfo); + recvData >> movementCounter; - recvData.read_skip(); // spline id - - // in taxi flight packet received in 2 case: - // 1) end taxi path in far (multi-node) flight - // 2) switch from one map to other in case multim-map taxi path - // we need process only (1) - - uint32 curDest = GetPlayer()->m_taxi.GetTaxiDestination(); - if (curDest) + if (_player->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_TAXI_FLIGHT)) // taxi spline case { - TaxiNodesEntry const* curDestNode = sTaxiNodesStore.LookupEntry(curDest); + // in taxi flight packet received in 2 case: + // 1) end taxi path in far (multi-node) flight + // 2) switch from one map to other in case multim-map taxi path + // we need process only (1) - // far teleport case - if (curDestNode && curDestNode->map_id != GetPlayer()->GetMapId() && GetPlayer()->GetMotionMaster()->GetCurrentMovementGeneratorType() == FLIGHT_MOTION_TYPE) + uint32 curDest = GetPlayer()->m_taxi.GetTaxiDestination(); + if (curDest) { - if (FlightPathMovementGenerator* flight = dynamic_cast(GetPlayer()->GetMotionMaster()->top())) - { - // short preparations to continue flight - flight->SetCurrentNodeAfterTeleport(); - TaxiPathNodeEntry const* node = flight->GetPath()[flight->GetCurrentNode()]; - flight->SkipCurrentNode(); + TaxiNodesEntry const* curDestNode = sTaxiNodesStore.LookupEntry(curDest); - GetPlayer()->TeleportTo(curDestNode->map_id, node->x, node->y, node->z, GetPlayer()->GetOrientation(), TELE_TO_NOT_LEAVE_TAXI); + // far teleport case + if (curDestNode && curDestNode->map_id != GetPlayer()->GetMapId() && GetPlayer()->GetMotionMaster()->GetCurrentMovementGeneratorType() == FLIGHT_MOTION_TYPE) + { + if (FlightPathMovementGenerator* flight = dynamic_cast(GetPlayer()->GetMotionMaster()->top())) + { + // short preparations to continue flight + flight->SetCurrentNodeAfterTeleport(); + TaxiPathNodeEntry const* node = flight->GetPath()[flight->GetCurrentNode()]; + flight->SkipCurrentNode(); + + GetPlayer()->TeleportTo(curDestNode->map_id, node->x, node->y, node->z, GetPlayer()->GetOrientation(), TELE_TO_NOT_LEAVE_TAXI); + } } + + return; } + // at this point only 1 node is expected (final destination) + if (GetPlayer()->m_taxi.GetPath().size() != 1) + { + return; + } + + GetPlayer()->CleanupAfterTaxiFlight(); + GetPlayer()->SetFallInformation(GameTime::GetGameTime().count(), GetPlayer()->GetPositionZ()); + if (GetPlayer()->pvpInfo.IsHostile) + { + GetPlayer()->CastSpell(GetPlayer(), 2479, true); + } return; } - // at this point only 1 node is expected (final destination) - if (GetPlayer()->m_taxi.GetPath().size() != 1) - { + if (mover->GetGUID() != guid) return; - } - GetPlayer()->CleanupAfterTaxiFlight(); - GetPlayer()->SetFallInformation(GameTime::GetGameTime().count(), GetPlayer()->GetPositionZ()); - if (GetPlayer()->pvpInfo.IsHostile) - { - GetPlayer()->CastSpell(GetPlayer(), 2479, true); - } + if (!_player->IsExpectingChangeTransport() || !mover->movespline || mover->movespline->GetId() != movementCounter) + return; + + _player->SetExpectingChangeTransport(false); + WorldPacket data(_player->m_movementInfo.HasMovementFlag(MOVEMENTFLAG_ROOT) ? MSG_MOVE_ROOT : MSG_MOVE_UNROOT, recvData.size()); + WriteMovementInfo(&data, &movementInfo); + mover->SendMessageToSet(&data, _player); } void WorldSession::HandleActivateTaxiOpcode(WorldPacket& recvData) diff --git a/src/server/game/Movement/Spline/MoveSpline.h b/src/server/game/Movement/Spline/MoveSpline.h index 5ebe5f5aa..eaba1d53f 100644 --- a/src/server/game/Movement/Spline/MoveSpline.h +++ b/src/server/game/Movement/Spline/MoveSpline.h @@ -117,6 +117,7 @@ namespace Movement [[nodiscard]] bool isCyclic() const { return splineflags.cyclic; } [[nodiscard]] bool isFalling() const { return splineflags.falling; } [[nodiscard]] bool isWalking() const { return splineflags.walkmode; } + [[nodiscard]] bool isBoarding() const { return splineflags.transportEnter || splineflags.transportExit; } [[nodiscard]] Vector3 FinalDestination() const { return Initialized() ? spline.getPoint(spline.last()) : Vector3(); } [[nodiscard]] Vector3 CurrentDestination() const { return Initialized() ? spline.getPoint(point_Idx + 1) : Vector3(); } [[nodiscard]] int32 currentPathIdx() const; From 3bbcc152332c2c1fc7ca92a08a80bc709f42f1d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Francesco=20Borz=C3=AC?= Date: Sun, 26 Oct 2025 13:43:22 +0100 Subject: [PATCH 04/28] fix(CI): improve caching (#23387) --- .github/actions/linux-build/action.yml | 56 +++++++++++++++++++----- .github/workflows/core-build-nopch.yml | 6 ++- .github/workflows/core-build-pch.yml | 6 ++- .github/workflows/core_modules_build.yml | 6 ++- .github/workflows/dashboard-ci.yml | 2 +- .github/workflows/docker_build.yml | 4 +- .github/workflows/macos_build.yml | 16 +++++-- .github/workflows/tools_build.yml | 2 +- .github/workflows/windows_build.yml | 2 +- 9 files changed, 78 insertions(+), 22 deletions(-) diff --git a/.github/actions/linux-build/action.yml b/.github/actions/linux-build/action.yml index 4da8f39b9..9d6208a7e 100644 --- a/.github/actions/linux-build/action.yml +++ b/.github/actions/linux-build/action.yml @@ -39,6 +39,10 @@ inputs: runs: using: composite steps: + - name: echo cache key + shell: bash + run: echo "Cache key -> ccache:${{ runner.os }}:${{ inputs.CC }}_${{ inputs.CXX }}:${{ inputs.modules }}:${{ github.ref_name }}" + - name: Cache uses: actions/cache@v4 if: inputs.pch != 'true' @@ -46,9 +50,8 @@ runs: path: ${{ github.workspace }}/var/ccache # format # ccache:OS:CC_CXX:MODULES:GITHUB_REF:GITHUB_SHA - key: ccache:${{ runner.os }}:${{ inputs.CC }}_${{ inputs.CXX }}:${{ inputs.modules }}:${{ github.ref }}:${{ github.sha }} + key: ccache:${{ runner.os }}:${{ inputs.CC }}_${{ inputs.CXX }}:${{ inputs.modules }}:${{ github.ref_name }} restore-keys: | - ccache:${{ runner.os }}:${{ inputs.CC }}_${{ inputs.CXX }}:${{ inputs.modules }}:${{ github.ref }} ccache:${{ runner.os }}:${{ inputs.CC }}_${{ inputs.CXX }}:${{ inputs.modules }} ccache:${{ runner.os }}:${{ inputs.CC }}_${{ inputs.CXX }} @@ -73,12 +76,12 @@ runs: UBUNTU_VERSION="$(grep VERSION_ID /etc/os-release | cut -f2 -d\")" source /etc/os-release if [[ "$VERSION_CODENAME" == "jammy" ]]; then - if [[ "${{ inputs.cc }}" =~ "clang-" ]]; then - CLANG_VERSION="$(echo '${{ inputs.cc }}' | cut -f2 -d\-)" + if [[ "${{ inputs.CC }}" =~ "clang-" ]]; then + CLANG_VERSION="$(echo '${{ inputs.CC }}' | cut -f2 -d\-)" wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - sudo add-apt-repository "deb http://apt.llvm.org/$VERSION_CODENAME/ llvm-toolchain-$VERSION_CODENAME-$CLANG_VERSION main" sudo apt-get -qq update - sudo apt-get -qq install '${{ inputs.cc }}' + sudo apt-get -qq install '${{ inputs.CC }}' fi fi @@ -87,19 +90,44 @@ runs: env: CCACHE_DIR: $GITHUB_WORKSPACE/var/ccache run: | - cat <> $GITHUB_ENV + mkdir -p "$CCACHE_DIR" + cat <> "$GITHUB_ENV" + CCACHE_BASEDIR=${GITHUB_WORKSPACE} CCACHE_DIR=${{ env.CCACHE_DIR }} - CCACHE_MAXSIZE=1000MB + CCACHE_HASHDIR=1 + CCACHE_MAXSIZE=5G CCACHE_SLOPPINESS=pch_defines,time_macros,include_file_mtime - CCACHE_CPP2=true CCACHE_COMPRESS=1 CCACHE_COMPRESSLEVEL=9 CCACHE_COMPILERCHECK=content - CCACHE_LOGFILE=$CCACHE_DIR/cache.debug + CCACHE_LOGFILE=${{ env.CCACHE_DIR }}/cache.debug CC=${{ inputs.CC }} CXX=${{ inputs.CXX }} EOF + - name: ccache config snapshot + shell: bash + run: | + echo "==== Effective ccache configuration ====" + ccache -p | egrep 'base_dir|hash_dir|compiler_check|sloppiness|max_size' || true + + echo + echo "==== Compiler info ====" + which ${{ inputs.CC }} && ${{ inputs.CC }} --version || true + which ${{ inputs.CXX }} && ${{ inputs.CXX }} --version || true + + echo + echo "==== Previous cache stats ====" + ccache -s || true + + echo + echo "==== Top cache results ====" + grep -o 'result: .*' "$CCACHE_DIR/cache.debug" 2>/dev/null | sort | uniq -c | sort -nr | head || true + + - name: reset ccache stats + shell: bash + run: ccache -z || true + - name: Configure shell: bash run: | @@ -107,6 +135,8 @@ runs: mkdir build cd build cmake "$GITHUB_WORKSPACE" \ + -DCMAKE_C_COMPILER="${{ inputs.CC }}" \ + -DCMAKE_CXX_COMPILER="${{ inputs.CXX }}" \ -DCMAKE_INSTALL_PREFIX="$GITHUB_WORKSPACE/env/dist" \ -DAPPS_BUILD="all" \ -DTOOLS_BUILD=${{ inputs.tools }} \ @@ -116,8 +146,8 @@ runs: -DCMAKE_BUILD_TYPE="Release" \ -DCMAKE_CXX_COMPILER_LAUNCHER="ccache" \ -DCMAKE_C_COMPILER_LAUNCHER="ccache" \ - -DCMAKE_C_FLAGS="-Werror ${{ startsWith(inputs.cc, 'clang') && '-ferror-limit=' || '-fmax-errors=' }}${{inputs.maxerrors}} " \ - -DCMAKE_CXX_FLAGS="-Werror ${{ startsWith(inputs.cxx, 'clang') && '-ferror-limit=' || '-fmax-errors=' }}${{inputs.maxerrors}}" \ + -DCMAKE_C_FLAGS="-Werror ${{ startsWith(inputs.CC, 'clang') && '-ferror-limit=' || '-fmax-errors=' }}${{inputs.maxerrors}} -fdebug-prefix-map=${GITHUB_WORKSPACE}=." \ + -DCMAKE_CXX_FLAGS="-Werror ${{ startsWith(inputs.CXX, 'clang') && '-ferror-limit=' || '-fmax-errors=' }}${{inputs.maxerrors}} -fdebug-prefix-map=${GITHUB_WORKSPACE}=." \ -DBUILD_TESTING="ON" \ -DUSE_SCRIPTPCH=${{ inputs.pch == 'true' && 'ON' || '' }} \ -DUSE_COREPCH=${{ inputs.pch == 'true' && 'ON' || '' }} \ @@ -190,3 +220,7 @@ runs: else exit 0 fi + + - name: ccache stats + shell: bash + run: ccache -s || true diff --git a/.github/workflows/core-build-nopch.yml b/.github/workflows/core-build-nopch.yml index e64fbffcc..e67e9463c 100644 --- a/.github/workflows/core-build-nopch.yml +++ b/.github/workflows/core-build-nopch.yml @@ -10,9 +10,13 @@ on: - synchronize concurrency: - group: ${{ github.head_ref }} || concat(${{ github.ref }}, ${{ github.workflow }}) + group: ${{ github.head_ref }} || concat(${{ github.ref_name }}, ${{ github.workflow }}) cancel-in-progress: true +permissions: + actions: write + contents: read + jobs: build: strategy: diff --git a/.github/workflows/core-build-pch.yml b/.github/workflows/core-build-pch.yml index f6c989346..8a752e450 100644 --- a/.github/workflows/core-build-pch.yml +++ b/.github/workflows/core-build-pch.yml @@ -10,9 +10,13 @@ on: - synchronize concurrency: - group: ${{ github.head_ref }} || concat(${{ github.ref }}, ${{ github.workflow }}) + group: ${{ github.head_ref }} || concat(${{ github.ref_name }}, ${{ github.workflow }}) cancel-in-progress: true +permissions: + actions: write + contents: read + jobs: build: strategy: diff --git a/.github/workflows/core_modules_build.yml b/.github/workflows/core_modules_build.yml index 45683f2b4..1ae3a1c02 100644 --- a/.github/workflows/core_modules_build.yml +++ b/.github/workflows/core_modules_build.yml @@ -19,8 +19,12 @@ on: - 'src/server/shared/**/*' - 'src/tools/**/*' +permissions: + actions: write + contents: read + concurrency: - group: ${{ github.head_ref }} || concat(${{ github.ref }}, ${{ github.workflow }}) + group: ${{ github.head_ref }} || concat(${{ github.ref_name }}, ${{ github.workflow }}) cancel-in-progress: true jobs: diff --git a/.github/workflows/dashboard-ci.yml b/.github/workflows/dashboard-ci.yml index 06b7940d3..67f805aac 100644 --- a/.github/workflows/dashboard-ci.yml +++ b/.github/workflows/dashboard-ci.yml @@ -16,7 +16,7 @@ on: workflow_dispatch: concurrency: - group: ${{ github.head_ref }} || concat(${{ github.ref }}, ${{ github.workflow }}) + group: ${{ github.head_ref }} || concat(${{ github.ref_name }}, ${{ github.workflow }}) cancel-in-progress: true env: diff --git a/.github/workflows/docker_build.yml b/.github/workflows/docker_build.yml index 0ab085e98..eee506a14 100644 --- a/.github/workflows/docker_build.yml +++ b/.github/workflows/docker_build.yml @@ -9,7 +9,7 @@ on: - synchronize concurrency: - group: ${{ github.head_ref }} || concat(${{ github.ref }}, ${{ github.workflow }}) + group: ${{ github.head_ref }} || concat(${{ github.ref_name }}, ${{ github.workflow }}) cancel-in-progress: true env: @@ -115,6 +115,6 @@ jobs: event-type: azerothcore-new-images client-payload: > { - "ref": "${{ github.ref }}", + "ref": "${{ github.ref_name }}", "sha": "${{ github.sha }}" } diff --git a/.github/workflows/macos_build.yml b/.github/workflows/macos_build.yml index 039cc5315..09ae976a2 100644 --- a/.github/workflows/macos_build.yml +++ b/.github/workflows/macos_build.yml @@ -9,9 +9,13 @@ on: - synchronize concurrency: - group: ${{ github.head_ref }} || concat(${{ github.ref }}, ${{ github.workflow }}) + group: ${{ github.head_ref }} || concat(${{ github.ref_name }}, ${{ github.workflow }}) cancel-in-progress: true +permissions: + actions: write + contents: read + jobs: macos-build: strategy: @@ -31,13 +35,19 @@ jobs: uses: actions/cache@v4 with: path: ~/Library/Caches/ccache - key: ccache:${{ matrix.os }}:${{ github.ref }}:${{ github.sha }} + key: ccache:${{ matrix.os }}:${{ github.ref_name }} restore-keys: | - ccache:${{ matrix.os }}:${{ github.ref }} + ccache:${{ matrix.os }}:${{ github.ref_name }} ccache:${{ matrix.os }} + - name: reset ccache stats + shell: bash + run: ccache -z || true - name: Install latest bash run: brew install bash - name: Configure OS run: source ./acore.sh install-deps - name: Build run: source ./apps/ci/mac/ci-compile.sh + - name: ccache stats + shell: bash + run: ccache -s || true diff --git a/.github/workflows/tools_build.yml b/.github/workflows/tools_build.yml index 09a8d68c1..5ad3bf3bf 100644 --- a/.github/workflows/tools_build.yml +++ b/.github/workflows/tools_build.yml @@ -9,7 +9,7 @@ on: - synchronize concurrency: - group: ${{ github.head_ref }} || concat(${{ github.ref }}, ${{ github.workflow }}) + group: ${{ github.head_ref }} || concat(${{ github.ref_name }}, ${{ github.workflow }}) cancel-in-progress: true jobs: diff --git a/.github/workflows/windows_build.yml b/.github/workflows/windows_build.yml index aa8700778..c01e3ff3c 100644 --- a/.github/workflows/windows_build.yml +++ b/.github/workflows/windows_build.yml @@ -9,7 +9,7 @@ on: - synchronize concurrency: - group: ${{ github.head_ref }} || concat(${{ github.ref }}, ${{ github.workflow }}) + group: ${{ github.head_ref }} || concat(${{ github.ref_name }}, ${{ github.workflow }}) cancel-in-progress: true jobs: From 299bf089bbcc216675a233b86a075ddeef2aa599 Mon Sep 17 00:00:00 2001 From: blinkysc <37940565+blinkysc@users.noreply.github.com> Date: Sun, 26 Oct 2025 08:48:55 -0500 Subject: [PATCH 05/28] fix(HoS/DB) Unrelenting Construct now linked (#23397) Co-authored-by: John Doe --- .../sql/updates/pending_db_world/rev_1761400284998690401.sql | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 data/sql/updates/pending_db_world/rev_1761400284998690401.sql diff --git a/data/sql/updates/pending_db_world/rev_1761400284998690401.sql b/data/sql/updates/pending_db_world/rev_1761400284998690401.sql new file mode 100644 index 000000000..f96b6ebec --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1761400284998690401.sql @@ -0,0 +1,5 @@ +-- +DELETE FROM `creature_formations` WHERE `leaderGUID` = 126740 OR `memberGUID` = 126740; +INSERT INTO `creature_formations` (`leaderGUID`, `memberGUID`, `dist`, `angle`, `groupAI`, `point_1`, `point_2`) VALUES +(126740, 126740, 0, 0, 3, 0, 0), +(126740, 126741, 0, 0, 3, 0, 0); From 989f14d4538895ce74d79d8de4ed1fac36e33f50 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 26 Oct 2025 14:03:55 +0000 Subject: [PATCH 06/28] chore(DB): import pending files Referenced commit(s): 299bf089bbcc216675a233b86a075ddeef2aa599 --- .../rev_1761400284998690401.sql => db_world/2025_10_26_00.sql} | 1 + 1 file changed, 1 insertion(+) rename data/sql/updates/{pending_db_world/rev_1761400284998690401.sql => db_world/2025_10_26_00.sql} (86%) diff --git a/data/sql/updates/pending_db_world/rev_1761400284998690401.sql b/data/sql/updates/db_world/2025_10_26_00.sql similarity index 86% rename from data/sql/updates/pending_db_world/rev_1761400284998690401.sql rename to data/sql/updates/db_world/2025_10_26_00.sql index f96b6ebec..d5f94ffe2 100644 --- a/data/sql/updates/pending_db_world/rev_1761400284998690401.sql +++ b/data/sql/updates/db_world/2025_10_26_00.sql @@ -1,3 +1,4 @@ +-- DB update 2025_10_25_01 -> 2025_10_26_00 -- DELETE FROM `creature_formations` WHERE `leaderGUID` = 126740 OR `memberGUID` = 126740; INSERT INTO `creature_formations` (`leaderGUID`, `memberGUID`, `dist`, `angle`, `groupAI`, `point_1`, `point_2`) VALUES From ab8afbb3ec128056522849228893d385f3e7a243 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Francesco=20Borz=C3=AC?= Date: Sun, 26 Oct 2025 15:24:14 +0100 Subject: [PATCH 07/28] feat(CI): enable caching for pch build (#23422) --- .github/actions/linux-build/action.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/actions/linux-build/action.yml b/.github/actions/linux-build/action.yml index 9d6208a7e..42938553f 100644 --- a/.github/actions/linux-build/action.yml +++ b/.github/actions/linux-build/action.yml @@ -41,17 +41,15 @@ runs: steps: - name: echo cache key shell: bash - run: echo "Cache key -> ccache:${{ runner.os }}:${{ inputs.CC }}_${{ inputs.CXX }}:${{ inputs.modules }}:${{ github.ref_name }}" + run: echo "Cache key -> ccache:${{ runner.os }}:${{ inputs.CC }}_${{ inputs.CXX }}:${{ inputs.modules }}:pch=${{ inputs.pch }}:${{ github.ref_name }}" - name: Cache uses: actions/cache@v4 - if: inputs.pch != 'true' with: path: ${{ github.workspace }}/var/ccache - # format - # ccache:OS:CC_CXX:MODULES:GITHUB_REF:GITHUB_SHA - key: ccache:${{ runner.os }}:${{ inputs.CC }}_${{ inputs.CXX }}:${{ inputs.modules }}:${{ github.ref_name }} + key: ccache:${{ runner.os }}:${{ inputs.CC }}_${{ inputs.CXX }}:${{ inputs.modules }}:pch=${{ inputs.pch }}:${{ github.ref_name }} restore-keys: | + ccache:${{ runner.os }}:${{ inputs.CC }}_${{ inputs.CXX }}:${{ inputs.modules }}:pch=${{ inputs.pch }} ccache:${{ runner.os }}:${{ inputs.CC }}_${{ inputs.CXX }}:${{ inputs.modules }} ccache:${{ runner.os }}:${{ inputs.CC }}_${{ inputs.CXX }} From a641d48ba21f610378116434c79c9528fc84e154 Mon Sep 17 00:00:00 2001 From: blinkysc <37940565+blinkysc@users.noreply.github.com> Date: Sun, 26 Oct 2025 11:17:47 -0500 Subject: [PATCH 08/28] fix(HoS/SmartAI) Fix issues with Dark Elementalist and added SmartAI for air elemental (#23404) Co-authored-by: John Doe --- .../pending_db_world/rev_1761410170705172220.sql | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 data/sql/updates/pending_db_world/rev_1761410170705172220.sql diff --git a/data/sql/updates/pending_db_world/rev_1761410170705172220.sql b/data/sql/updates/pending_db_world/rev_1761410170705172220.sql new file mode 100644 index 000000000..bce8f8bb9 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1761410170705172220.sql @@ -0,0 +1,15 @@ +-- Dark Rune Elementalist +UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = 27962; +DELETE FROM `smart_scripts` WHERE (`source_type` = 0 AND `entryorguid` = 27962); +INSERT INTO `smart_scripts` (`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_param6`, `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`, `comment`) VALUES +(27962, 0, 1, 0, 0, 0, 100, 6, 5000, 9000, 16000, 20000, 0, 0, 11, 51475, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Dark Rune Elementalist - In Combat - Cast \'Summon Air Elemental\' (Dungeon)'), +(27962, 0, 2, 0, 1, 0, 100, 2, 1000, 1000, 600000, 600000, 0, 0, 11, 51776, 32, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Dark Rune Elementalist - Out of Combat - Cast \'Lightning Shield\' (Normal Dungeon)'), +(27962, 0, 3, 0, 0, 0, 100, 2, 0, 0, 20000, 30000, 0, 0, 11, 51776, 32, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Dark Rune Elementalist - In Combat - Cast \'Lightning Shield\' (Normal Dungeon)'), +(27962, 0, 4, 0, 0, 0, 100, 6, 1000, 10000, 31000, 42000, 0, 0, 11, 32693, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Dark Rune Elementalist - In Combat - Cast \'Arcane Haste\' (Dungeon)'), +(27962, 0, 5, 0, 1, 0, 100, 4, 1000, 1000, 600000, 600000, 0, 0, 11, 59025, 32, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Dark Rune Elementalist - Out of Combat - Cast \'Lightning Shield\' (Heroic Dungeon)'), +(27962, 0, 6, 0, 0, 0, 100, 4, 0, 0, 20000, 30000, 0, 0, 11, 59025, 32, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Dark Rune Elementalist - In Combat - Cast \'Lightning Shield\' (Heroic Dungeon)'); +-- lesser air elemental +UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = 28384; +DELETE FROM `smart_scripts` WHERE (`entryorguid` = 28384) AND (`source_type` = 0) AND (`id` IN (0)); +INSERT INTO `smart_scripts` (`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_param6`, `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`, `comment`) VALUES +(28384, 0, 0, 0, 0, 0, 100, 6, 3000, 10000, 5000, 9000, 0, 0, 11, 15801, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Lesser Air Elemental - In Combat - Cast \'Lightning Bolt\''); From af2cb8d227a492d47218c0a9f496059ce3e39ae8 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 26 Oct 2025 16:18:57 +0000 Subject: [PATCH 09/28] chore(DB): import pending files Referenced commit(s): a641d48ba21f610378116434c79c9528fc84e154 --- .../rev_1761410170705172220.sql => db_world/2025_10_26_01.sql} | 1 + 1 file changed, 1 insertion(+) rename data/sql/updates/{pending_db_world/rev_1761410170705172220.sql => db_world/2025_10_26_01.sql} (98%) diff --git a/data/sql/updates/pending_db_world/rev_1761410170705172220.sql b/data/sql/updates/db_world/2025_10_26_01.sql similarity index 98% rename from data/sql/updates/pending_db_world/rev_1761410170705172220.sql rename to data/sql/updates/db_world/2025_10_26_01.sql index bce8f8bb9..73d43651c 100644 --- a/data/sql/updates/pending_db_world/rev_1761410170705172220.sql +++ b/data/sql/updates/db_world/2025_10_26_01.sql @@ -1,3 +1,4 @@ +-- DB update 2025_10_26_00 -> 2025_10_26_01 -- Dark Rune Elementalist UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = 27962; DELETE FROM `smart_scripts` WHERE (`source_type` = 0 AND `entryorguid` = 27962); From 6292f802199225ff2f02375d07eb4a92487cb438 Mon Sep 17 00:00:00 2001 From: killerwife Date: Sun, 26 Oct 2025 17:52:59 +0100 Subject: [PATCH 10/28] feature(SmartAI/Movement) - Unify waypoint systems (#23251) --- .../rev_1760881893133517800.sql | 14 +++ src/server/game/AI/SmartScripts/SmartAI.cpp | 93 ++++++++++++------- src/server/game/AI/SmartScripts/SmartAI.h | 10 +- .../game/AI/SmartScripts/SmartScript.cpp | 48 +++++----- .../game/AI/SmartScripts/SmartScriptMgr.cpp | 78 ++++++++-------- .../game/AI/SmartScripts/SmartScriptMgr.h | 73 ++++++--------- src/server/game/Movement/MotionMaster.cpp | 50 +++++----- src/server/game/Movement/MotionMaster.h | 10 +- .../WaypointMovementGenerator.cpp | 63 ++++++++----- .../WaypointMovementGenerator.h | 5 +- .../game/Movement/Waypoints/WaypointMgr.cpp | 69 +++++++------- .../game/Movement/Waypoints/WaypointMgr.h | 9 +- src/server/game/Scripting/MapScripts.cpp | 4 +- src/server/game/World/WorldState.cpp | 2 +- .../BlackrockSpire/boss_gyth.cpp | 2 +- .../BlackrockSpire/boss_rend_blackhand.cpp | 4 +- .../BlackrockSpire/boss_the_beast.cpp | 4 +- .../BlackwingLair/boss_chromaggus.cpp | 2 +- .../BlackwingLair/boss_nefarian.cpp | 6 +- .../Karazhan/boss_nightbane.cpp | 4 +- .../instance_magisters_terrace.cpp | 2 +- .../ScarletEnclave/chapter2.cpp | 30 +++--- .../ScarletEnclave/chapter5.cpp | 2 +- .../Scholomance/boss_kirtonos_the_herald.cpp | 2 +- .../SunwellPlateau/boss_felmyst.cpp | 4 +- .../EasternKingdoms/ZulAman/boss_nalorakk.cpp | 6 +- .../EasternKingdoms/ZulAman/zulaman.cpp | 8 +- .../ZulGurub/boss_gahzranka.cpp | 2 +- .../EasternKingdoms/ZulGurub/boss_jeklik.cpp | 6 +- .../EasternKingdoms/zone_elwynn_forest.cpp | 16 ++-- .../EasternKingdoms/zone_eversong_woods.cpp | 2 +- .../zone_isle_of_queldanas.cpp | 6 +- .../EasternKingdoms/zone_undercity.cpp | 22 ++--- src/server/scripts/Events/hallows_end.cpp | 4 +- .../BattleForMountHyjal/boss_anetheron.cpp | 4 +- .../BattleForMountHyjal/boss_azgalor.cpp | 2 +- .../BattleForMountHyjal/boss_kazrogal.cpp | 2 +- .../boss_rage_winterchill.cpp | 4 +- .../BattleForMountHyjal/hyjal.cpp | 22 ++--- .../boss_lieutenant_drake.cpp | 4 +- .../Kalimdor/RazorfenDowns/razorfen_downs.cpp | 2 +- .../Kalimdor/RuinsOfAhnQiraj/boss_ayamiss.cpp | 6 +- .../RuinsOfAhnQiraj/boss_ossirian.cpp | 2 +- .../TempleOfAhnQiraj/boss_bug_trio.cpp | 2 +- .../Kalimdor/ZulFarrak/instance_zulfarrak.cpp | 2 +- .../AzjolNerub/AzjolNerub/boss_hadronox.cpp | 6 +- .../ObsidianSanctum/boss_sartharion.cpp | 6 +- .../ForgeOfSouls/instance_forge_of_souls.cpp | 2 +- .../PitOfSaron/boss_krickandick.cpp | 4 +- .../PitOfSaron/boss_scourgelord_tyrannus.cpp | 2 +- .../FrozenHalls/PitOfSaron/pit_of_saron.cpp | 4 +- .../IcecrownCitadel/icecrown_citadel.cpp | 2 +- .../instance_icecrown_citadel.cpp | 2 +- .../Ulduar/Ulduar/boss_flame_leviathan.cpp | 2 +- .../Ulduar/Ulduar/boss_razorscale.cpp | 12 +-- .../UtgardeKeep/UtgardeKeep/utgarde_keep.cpp | 2 +- .../scripts/Northrend/zone_borean_tundra.cpp | 10 +- .../Northrend/zone_crystalsong_forest.cpp | 20 +--- .../scripts/Northrend/zone_dragonblight.cpp | 2 +- .../scripts/Northrend/zone_grizzly_hills.cpp | 30 +++--- .../scripts/Northrend/zone_icecrown.cpp | 20 +--- .../scripts/Northrend/zone_sholazar_basin.cpp | 12 +-- .../scripts/Northrend/zone_storm_peaks.cpp | 34 +------ .../boss_ambassador_hellmaw.cpp | 6 +- .../Outland/BlackTemple/boss_illidan.cpp | 8 +- .../boss_hydross_the_unstable.cpp | 2 +- .../SlavePens/the_slave_pens.cpp | 2 +- .../underbog/boss_ghazan.cpp | 2 +- .../ShatteredHalls/boss_porung.cpp | 2 +- .../Outland/TempestKeep/Eye/boss_alar.cpp | 12 +-- .../Outland/zone_shadowmoon_valley.cpp | 12 +-- 71 files changed, 447 insertions(+), 485 deletions(-) create mode 100644 data/sql/updates/pending_db_world/rev_1760881893133517800.sql diff --git a/data/sql/updates/pending_db_world/rev_1760881893133517800.sql b/data/sql/updates/pending_db_world/rev_1760881893133517800.sql new file mode 100644 index 000000000..a831499ac --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1760881893133517800.sql @@ -0,0 +1,14 @@ +-- `point`s had gaps causing core code needing to be extra complicated +UPDATE `waypoint_data` SET `point`=1 WHERE `id`=1336190 AND `point`=2 AND `action`=1336191; +UPDATE `waypoint_data` SET `point`=2 WHERE `id`=1336190 AND `point`=4 AND `action`=1336192; +UPDATE `waypoint_data` SET `point`=3 WHERE `id`=1336190 AND `point`=6 AND `action`=1336192; + +UPDATE `waypoint_data` SET `point`=`point`-1 WHERE `id`=795240 AND `point`>4; + +UPDATE `waypoint_data` SET `point`=`point`-1 WHERE `id`=497520 AND `point`>21; +UPDATE `waypoint_data` SET `point`=`point`-1 WHERE `id`=497520 AND `point`>33; + +UPDATE `waypoint_data` SET `point`=`point`-15 WHERE `id`=1873101 AND `point`>0; +UPDATE `waypoint_data` SET `point`=`point`-1 WHERE `id`=1873101 AND `point`>5; + +UPDATE `waypoint_data` SET `point`=`point`-1 WHERE `id`=1110490 AND `point`>187; diff --git a/src/server/game/AI/SmartScripts/SmartAI.cpp b/src/server/game/AI/SmartScripts/SmartAI.cpp index 08ea86b8c..e799c923c 100644 --- a/src/server/game/AI/SmartScripts/SmartAI.cpp +++ b/src/server/game/AI/SmartScripts/SmartAI.cpp @@ -108,20 +108,20 @@ void SmartAI::UpdateDespawn(const uint32 diff) mDespawnTime -= diff; } -WayPoint* SmartAI::GetNextWayPoint() +WaypointData const* SmartAI::GetNextWayPoint() { if (!mWayPoints || mWayPoints->empty()) return nullptr; mCurrentWPID++; - WPPath::const_iterator itr = mWayPoints->find(mCurrentWPID); + auto itr = mWayPoints->find(mCurrentWPID); if (itr != mWayPoints->end()) { - mLastWP = (*itr).second; + mLastWP = &(*itr).second; if (mLastWP->id != mCurrentWPID) LOG_ERROR("scripts.ai.sai", "SmartAI::GetNextWayPoint: Got not expected waypoint id {}, expected {}", mLastWP->id, mCurrentWPID); - return (*itr).second; + return &(*itr).second; } return nullptr; } @@ -138,12 +138,15 @@ void SmartAI::GenerateWayPointArray(Movement::PointsArray* points) points->clear(); points->push_back(G3D::Vector3(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ())); uint32 wpCounter = mCurrentWPID; - WPPath::const_iterator itr; - while ((itr = mWayPoints->find(wpCounter++)) != mWayPoints->end()) + auto itr = mWayPoints->find(wpCounter++); + do { - WayPoint* wp = (*itr).second; - points->push_back(G3D::Vector3(wp->x, wp->y, wp->z)); + WaypointData const& wp = (*itr).second; + points->push_back(G3D::Vector3(wp.x, wp.y, wp.z)); + + itr = mWayPoints->find(wpCounter++); } + while (itr != mWayPoints->end()); } else { @@ -152,16 +155,17 @@ void SmartAI::GenerateWayPointArray(Movement::PointsArray* points) std::vector pVector; // xinef: first point in vector is unit real position pVector.push_back(G3D::Vector3(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ())); - uint32 length = (mWayPoints->size() - mCurrentWPID) * size; - - uint32 cnt = 0; uint32 wpCounter = mCurrentWPID; - WPPath::const_iterator itr; - while ((itr = mWayPoints->find(wpCounter++)) != mWayPoints->end() && cnt++ <= length) + + auto itr = mWayPoints->find(wpCounter++); + do { - WayPoint* wp = (*itr).second; - pVector.push_back(G3D::Vector3(wp->x, wp->y, wp->z)); + WaypointData const& wp = (*itr).second; + pVector.push_back(G3D::Vector3(wp.x, wp.y, wp.z)); + + itr = mWayPoints->find(wpCounter++); } + while (itr != mWayPoints->end()); if (pVector.size() > 2) // more than source + dest { @@ -189,21 +193,21 @@ void SmartAI::GenerateWayPointArray(Movement::PointsArray* points) } } -void SmartAI::StartPath(ForcedMovement forcedMovement, uint32 path, bool repeat, Unit* invoker) +void SmartAI::StartPath(ForcedMovement forcedMovement, uint32 path, bool repeat, Unit* invoker, PathSource pathSource) { if (HasEscortState(SMART_ESCORT_ESCORTING)) StopPath(); if (path) { - if (!LoadPath(path)) + if (!LoadPath(path, pathSource)) return; } if (!mWayPoints || mWayPoints->empty()) return; - if (WayPoint* wp = GetNextWayPoint()) + if (WaypointData const* wp = GetNextWayPoint()) { AddEscortState(SMART_ESCORT_ESCORTING); mCanRepeatPath = repeat; @@ -219,20 +223,37 @@ void SmartAI::StartPath(ForcedMovement forcedMovement, uint32 path, bool repeat, GenerateWayPointArray(&pathPoints); me->GetMotionMaster()->MoveSplinePath(&pathPoints, mForcedMovement); - GetScript()->ProcessEventsFor(SMART_EVENT_WAYPOINT_START, nullptr, wp->id, GetScript()->GetPathId()); + GetScript()->ProcessEventsFor(SMART_EVENT_ESCORT_START, nullptr, wp->id, GetScript()->GetPathId()); } } -bool SmartAI::LoadPath(uint32 entry) +bool SmartAI::LoadPath(uint32 entry, PathSource pathSource) { if (HasEscortState(SMART_ESCORT_ESCORTING)) return false; - mWayPoints = sSmartWaypointMgr->GetPath(entry); - if (!mWayPoints) + switch (pathSource) { - GetScript()->SetPathId(0); - return false; + case PathSource::SMART_WAYPOINT_MGR: + { + mWayPoints = sSmartWaypointMgr->GetPath(entry); + if (!mWayPoints) + { + GetScript()->SetPathId(0); + return false; + } + break; + } + case PathSource::WAYPOINT_MGR: + { + mWayPoints = sWaypointMgr->GetPath(entry); + if (!mWayPoints) + { + GetScript()->SetPathId(0); + return false; + } + break; + } } GetScript()->SetPathId(entry); @@ -262,12 +283,12 @@ void SmartAI::PausePath(uint32 delay, bool forced) me->GetMotionMaster()->MoveIdle();//force stop auto waypoint = mWayPoints->find(mCurrentWPID); - if (waypoint->second->o.has_value()) + if (waypoint->second.orientation.has_value()) { - me->SetFacingTo(waypoint->second->o.has_value()); + me->SetFacingTo(*waypoint->second.orientation); } } - GetScript()->ProcessEventsFor(SMART_EVENT_WAYPOINT_PAUSED, nullptr, mCurrentWPID, GetScript()->GetPathId()); + GetScript()->ProcessEventsFor(SMART_EVENT_ESCORT_PAUSED, nullptr, mCurrentWPID, GetScript()->GetPathId()); } void SmartAI::StopPath(uint32 DespawnTime, uint32 quest, bool fail) @@ -285,7 +306,7 @@ void SmartAI::StopPath(uint32 DespawnTime, uint32 quest, bool fail) me->StopMoving(); me->GetMotionMaster()->MoveIdle(); - GetScript()->ProcessEventsFor(SMART_EVENT_WAYPOINT_STOPPED, nullptr, mCurrentWPID, GetScript()->GetPathId()); + GetScript()->ProcessEventsFor(SMART_EVENT_ESCORT_STOPPED, nullptr, mCurrentWPID, GetScript()->GetPathId()); EndPath(fail); } @@ -354,13 +375,13 @@ void SmartAI::EndPath(bool fail) return; } - GetScript()->ProcessEventsFor(SMART_EVENT_WAYPOINT_ENDED, nullptr, mCurrentWPID, GetScript()->GetPathId()); + GetScript()->ProcessEventsFor(SMART_EVENT_ESCORT_ENDED, nullptr, mCurrentWPID, GetScript()->GetPathId()); mCurrentWPID = 0; if (mCanRepeatPath) { if (IsAIControlled()) - StartPath(FORCED_MOVEMENT_NONE, GetScript()->GetPathId(), true); + StartPath(mForcedMovement, GetScript()->GetPathId(), true); } else GetScript()->SetPathId(0); @@ -420,7 +441,7 @@ void SmartAI::UpdatePath(const uint32 diff) { if (!me->IsInCombat() && !HasEscortState(SMART_ESCORT_RETURNING) && (mWPReached || mForcedPaused)) { - GetScript()->ProcessEventsFor(SMART_EVENT_WAYPOINT_RESUMED, nullptr, mCurrentWPID, GetScript()->GetPathId()); + GetScript()->ProcessEventsFor(SMART_EVENT_ESCORT_RESUMED, nullptr, mCurrentWPID, GetScript()->GetPathId()); RemoveEscortState(SMART_ESCORT_PAUSED); if (mForcedPaused)// if paused between 2 wps resend movement { @@ -599,7 +620,7 @@ void SmartAI::MovepointReached(uint32 id) } mWPReached = true; - GetScript()->ProcessEventsFor(SMART_EVENT_WAYPOINT_REACHED, nullptr, mCurrentWPID); + GetScript()->ProcessEventsFor(SMART_EVENT_ESCORT_REACHED, nullptr, mCurrentWPID); if (mLastWP) { @@ -636,7 +657,7 @@ void SmartAI::MovementInform(uint32 MovementType, uint32 Data) me->ClearUnitState(UNIT_STATE_EVADE); if (MovementType == WAYPOINT_MOTION_TYPE) - GetScript()->ProcessEventsFor(SMART_EVENT_WAYPOINT_DATA_REACHED, nullptr, Data + 1); // Data + 1 to align smart_scripts and waypoint_data Id rows + GetScript()->ProcessEventsFor(SMART_EVENT_WAYPOINT_REACHED, nullptr, Data); // data now corresponds to columns GetScript()->ProcessEventsFor(SMART_EVENT_MOVEMENTINFORM, nullptr, MovementType, Data); if (!HasEscortState(SMART_ESCORT_ESCORTING)) @@ -786,7 +807,7 @@ void SmartAI::JustReachedHome() GetScript()->ProcessEventsFor(SMART_EVENT_REACHED_HOME); if (!UpdateVictim() && me->GetMotionMaster()->GetCurrentMovementGeneratorType() == IDLE_MOTION_TYPE && me->GetWaypointPath()) - me->GetMotionMaster()->MovePath(me->GetWaypointPath(), true); + me->GetMotionMaster()->MoveWaypoint(me->GetWaypointPath(), true); } mJustReset = false; @@ -943,7 +964,7 @@ void SmartAI::OnCharmed(bool /* apply */) if (!charmed && !me->IsInEvadeMode()) { if (mCanRepeatPath) - StartPath(FORCED_MOVEMENT_NONE, GetScript()->GetPathId(), true); + StartPath(mForcedMovement, GetScript()->GetPathId(), true); if (Unit* charmer = me->GetCharmer()) AttackStart(charmer); @@ -1149,7 +1170,7 @@ void SmartAI::OnSpellClick(Unit* clicker, bool& /*result*/) void SmartAI::PathEndReached(uint32 /*pathId*/) { - GetScript()->ProcessEventsFor(SMART_EVENT_WAYPOINT_DATA_ENDED, nullptr, 0, me->GetWaypointPath()); + GetScript()->ProcessEventsFor(SMART_EVENT_WAYPOINT_ENDED, nullptr, 0, me->GetWaypointPath()); me->LoadPath(0); } diff --git a/src/server/game/AI/SmartScripts/SmartAI.h b/src/server/game/AI/SmartScripts/SmartAI.h index 6233e2589..3551f681d 100644 --- a/src/server/game/AI/SmartScripts/SmartAI.h +++ b/src/server/game/AI/SmartScripts/SmartAI.h @@ -52,13 +52,13 @@ public: bool IsAIControlled() const; // Start moving to the desired MovePoint - void StartPath(ForcedMovement forcedMovement = FORCED_MOVEMENT_NONE, uint32 path = 0, bool repeat = false, Unit* invoker = nullptr); - bool LoadPath(uint32 entry); + void StartPath(ForcedMovement forcedMovement = FORCED_MOVEMENT_NONE, uint32 path = 0, bool repeat = false, Unit* invoker = nullptr, PathSource pathSource = PathSource::SMART_WAYPOINT_MGR); + bool LoadPath(uint32 entry, PathSource pathSource); void PausePath(uint32 delay, bool forced = false); void StopPath(uint32 DespawnTime = 0, uint32 quest = 0, bool fail = false); void EndPath(bool fail = false); void ResumePath(); - WayPoint* GetNextWayPoint(); + WaypointData const* GetNextWayPoint(); void GenerateWayPointArray(Movement::PointsArray* points); bool HasEscortState(uint32 uiEscortState) { return (mEscortState & uiEscortState); } void AddEscortState(uint32 uiEscortState) { mEscortState |= uiEscortState; } @@ -227,13 +227,13 @@ private: void ReturnToLastOOCPos(); void UpdatePath(const uint32 diff); SmartScript mScript; - WPPath* mWayPoints; + WaypointPath const* mWayPoints; uint32 mEscortState; uint32 mCurrentWPID; bool mWPReached; bool mOOCReached; uint32 mWPPauseTimer; - WayPoint* mLastWP; + WaypointData const* mLastWP; uint32 mEscortNPCFlags; uint32 GetWPCount() { return mWayPoints ? mWayPoints->size() : 0; } bool mCanRepeatPath; diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp index 38febbc9f..0991290b2 100644 --- a/src/server/game/AI/SmartScripts/SmartScript.cpp +++ b/src/server/game/AI/SmartScripts/SmartScript.cpp @@ -1723,7 +1723,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u StoreCounter(e.action.setCounter.counterId, e.action.setCounter.value, e.action.setCounter.reset, e.action.setCounter.subtract); break; } - case SMART_ACTION_WP_START: + case SMART_ACTION_ESCORT_START: { if (!IsSmart()) break; @@ -1750,16 +1750,16 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u CAST_AI(SmartAI, me->AI())->SetDespawnTime(DespawnTime); break; } - case SMART_ACTION_WP_PAUSE: + case SMART_ACTION_ESCORT_PAUSE: { if (!IsSmart()) break; uint32 delay = e.action.wpPause.delay; - CAST_AI(SmartAI, me->AI())->PausePath(delay, e.GetEventType() == SMART_EVENT_WAYPOINT_REACHED ? false : true); + CAST_AI(SmartAI, me->AI())->PausePath(delay, e.GetEventType() == SMART_EVENT_ESCORT_REACHED ? false : true); break; } - case SMART_ACTION_WP_STOP: + case SMART_ACTION_ESCORT_STOP: { if (!IsSmart()) break; @@ -1770,7 +1770,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u CAST_AI(SmartAI, me->AI())->StopPath(DespawnTime, quest, fail); break; } - case SMART_ACTION_WP_RESUME: + case SMART_ACTION_ESCORT_RESUME: { if (!IsSmart()) break; @@ -2519,21 +2519,19 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u { for (uint32 wp = e.action.startClosestWaypoint.pathId1; wp <= e.action.startClosestWaypoint.pathId2; ++wp) { - WPPath* path = sSmartWaypointMgr->GetPath(wp); + WaypointPath* path = sSmartWaypointMgr->GetPath(wp); if (!path || path->empty()) continue; auto itrWp = path->find(1); if (itrWp != path->end()) { - if (WayPoint* wpData = itrWp->second) + WaypointData& wpData = itrWp->second; + float distToThisPath = creature->GetExactDistSq(wpData.x, wpData.y, wpData.z); + if (distToThisPath < distanceToClosest) { - float distToThisPath = creature->GetExactDistSq(wpData->x, wpData->y, wpData->z); - if (distToThisPath < distanceToClosest) - { - distanceToClosest = distToThisPath; - closestWpId = wp; - } + distanceToClosest = distToThisPath; + closestWpId = wp; } } } @@ -3221,7 +3219,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u } break; } - case SMART_ACTION_WAYPOINT_DATA_START: + case SMART_ACTION_WAYPOINT_START: { if (e.action.wpData.pathId) { @@ -3230,7 +3228,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u if (IsCreature(target)) { target->ToCreature()->LoadPath(e.action.wpData.pathId); - target->ToCreature()->GetMotionMaster()->MovePath(e.action.wpData.pathId, e.action.wpData.repeat); + target->ToCreature()->GetMotionMaster()->MoveWaypoint(e.action.wpData.pathId, e.action.wpData.repeat, e.action.wpData.pathSource); } } } @@ -3247,7 +3245,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u { uint32 path = urand(e.action.wpDataRandom.pathId1, e.action.wpDataRandom.pathId2); target->ToCreature()->LoadPath(path); - target->ToCreature()->GetMotionMaster()->MovePath(path, e.action.wpDataRandom.repeat); + target->ToCreature()->GetMotionMaster()->MoveWaypoint(path, e.action.wpDataRandom.repeat); } } } @@ -4398,22 +4396,24 @@ void SmartScript::ProcessEvent(SmartScriptHolder& e, Unit* unit, uint32 var0, ui { if ((e.event.movementInform.type && var0 != e.event.movementInform.type) || (e.event.movementInform.id && var1 != e.event.movementInform.id)) return; + if (e.event.movementInform.pathId != 0 && e.event.movementInform.pathId != me->GetWaypointPath()) + return; ProcessAction(e, unit, var0, var1); break; } case SMART_EVENT_TRANSPORT_RELOCATE: - case SMART_EVENT_WAYPOINT_START: + case SMART_EVENT_ESCORT_START: { if (e.event.waypoint.pathID && var0 != e.event.waypoint.pathID) return; ProcessAction(e, unit, var0); break; } - case SMART_EVENT_WAYPOINT_REACHED: - case SMART_EVENT_WAYPOINT_RESUMED: - case SMART_EVENT_WAYPOINT_PAUSED: - case SMART_EVENT_WAYPOINT_STOPPED: - case SMART_EVENT_WAYPOINT_ENDED: + case SMART_EVENT_ESCORT_REACHED: + case SMART_EVENT_ESCORT_RESUMED: + case SMART_EVENT_ESCORT_PAUSED: + case SMART_EVENT_ESCORT_STOPPED: + case SMART_EVENT_ESCORT_ENDED: { if (!me || (e.event.waypoint.pointID && var0 != e.event.waypoint.pointID) || (e.event.waypoint.pathID && GetPathId() != e.event.waypoint.pathID)) return; @@ -4807,8 +4807,8 @@ void SmartScript::ProcessEvent(SmartScriptHolder& e, Unit* unit, uint32 var0, ui RecalcTimer(e, 1200, 1200); break; } - case SMART_EVENT_WAYPOINT_DATA_REACHED: - case SMART_EVENT_WAYPOINT_DATA_ENDED: + case SMART_EVENT_WAYPOINT_REACHED: + case SMART_EVENT_WAYPOINT_ENDED: { if (!me || (e.event.wpData.pointId && var0 != e.event.wpData.pointId) || (e.event.wpData.pathId && me->GetWaypointPath() != e.event.wpData.pathId)) return; diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp index 47c5c9166..ac5ba3d55 100644 --- a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp +++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp @@ -48,12 +48,9 @@ void SmartWaypointMgr::LoadFromDB() { uint32 oldMSTime = getMSTime(); - for (std::unordered_map::iterator itr = waypoint_map.begin(); itr != waypoint_map.end(); ++itr) + for (auto itr : waypoint_map) { - for (WPPath::iterator pathItr = itr->second->begin(); pathItr != itr->second->end(); ++pathItr) - delete pathItr->second; - - delete itr->second; + delete itr.second; } waypoint_map.clear(); @@ -88,7 +85,7 @@ void SmartWaypointMgr::LoadFromDB() if (last_entry != entry) { - waypoint_map[entry] = new WPPath(); + waypoint_map[entry] = new WaypointPath(); last_id = 1; count++; } @@ -97,7 +94,15 @@ void SmartWaypointMgr::LoadFromDB() LOG_ERROR("sql.sql", "SmartWaypointMgr::LoadFromDB: Path entry {}, unexpected point id {}, expected {}.", entry, id, last_id); last_id++; - (*waypoint_map[entry])[id] = new WayPoint(id, x, y, z, o, delay); + WaypointData data; + data.id = id; + data.x = x; + data.y = y; + data.z = z; + data.orientation = o; + data.delay = delay; + data.move_type = WAYPOINT_MOVE_TYPE_MAX; + (*waypoint_map[entry]).emplace(id, data); last_entry = entry; total++; @@ -109,12 +114,9 @@ void SmartWaypointMgr::LoadFromDB() SmartWaypointMgr::~SmartWaypointMgr() { - for (std::unordered_map::iterator itr = waypoint_map.begin(); itr != waypoint_map.end(); ++itr) + for (auto itr : waypoint_map) { - for (WPPath::iterator pathItr = itr->second->begin(); pathItr != itr->second->end(); ++pathItr) - delete pathItr->second; - - delete itr->second; + delete itr.second; } } @@ -625,8 +627,8 @@ bool SmartAIMgr::CheckUnusedEventParams(SmartScriptHolder const& e) case SMART_EVENT_CORPSE_REMOVED: return NO_PARAMS; case SMART_EVENT_AI_INIT: return NO_PARAMS; case SMART_EVENT_DATA_SET: return sizeof(SmartEvent::dataSet); - case SMART_EVENT_WAYPOINT_START: return sizeof(SmartEvent::waypoint); - case SMART_EVENT_WAYPOINT_REACHED: return sizeof(SmartEvent::waypoint); + case SMART_EVENT_ESCORT_START: return sizeof(SmartEvent::waypoint); + case SMART_EVENT_ESCORT_REACHED: return sizeof(SmartEvent::waypoint); case SMART_EVENT_TRANSPORT_ADDPLAYER: return NO_PARAMS; case SMART_EVENT_TRANSPORT_ADDCREATURE: return sizeof(SmartEvent::transportAddCreature); case SMART_EVENT_TRANSPORT_REMOVE_PLAYER: return NO_PARAMS; @@ -641,10 +643,10 @@ bool SmartAIMgr::CheckUnusedEventParams(SmartScriptHolder const& e) case SMART_EVENT_TEXT_OVER: return sizeof(SmartEvent::textOver); case SMART_EVENT_RECEIVE_HEAL: return sizeof(SmartEvent::minMaxRepeat); case SMART_EVENT_JUST_SUMMONED: return NO_PARAMS; - case SMART_EVENT_WAYPOINT_PAUSED: return sizeof(SmartEvent::waypoint); - case SMART_EVENT_WAYPOINT_RESUMED: return sizeof(SmartEvent::waypoint); - case SMART_EVENT_WAYPOINT_STOPPED: return sizeof(SmartEvent::waypoint); - case SMART_EVENT_WAYPOINT_ENDED: return sizeof(SmartEvent::waypoint); + case SMART_EVENT_ESCORT_PAUSED: return sizeof(SmartEvent::waypoint); + case SMART_EVENT_ESCORT_RESUMED: return sizeof(SmartEvent::waypoint); + case SMART_EVENT_ESCORT_STOPPED: return sizeof(SmartEvent::waypoint); + case SMART_EVENT_ESCORT_ENDED: return sizeof(SmartEvent::waypoint); case SMART_EVENT_TIMED_EVENT_TRIGGERED: return sizeof(SmartEvent::timedEvent); case SMART_EVENT_UPDATE: return sizeof(SmartEvent::minMaxRepeat); case SMART_EVENT_LINK: return NO_PARAMS; @@ -677,8 +679,8 @@ bool SmartAIMgr::CheckUnusedEventParams(SmartScriptHolder const& e) case SMART_EVENT_AREA_CASTING: return sizeof(SmartEvent::minMaxRepeat); case SMART_EVENT_AREA_RANGE: return sizeof(SmartEvent::minMaxRepeat); case SMART_EVENT_SUMMONED_UNIT_EVADE: return sizeof(SmartEvent::summoned); - case SMART_EVENT_WAYPOINT_DATA_REACHED: return sizeof(SmartEvent::wpData); - case SMART_EVENT_WAYPOINT_DATA_ENDED: return sizeof(SmartEvent::wpData); + case SMART_EVENT_WAYPOINT_REACHED: return sizeof(SmartEvent::wpData); + case SMART_EVENT_WAYPOINT_ENDED: return sizeof(SmartEvent::wpData); default: LOG_WARN("sql.sql", "SmartAIMgr: entryorguid {} source_type {} id {} action_type {} is using an event {} with no unused params specified in SmartAIMgr::CheckUnusedEventParams(), please report this.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.GetEventType()); @@ -765,9 +767,9 @@ bool SmartAIMgr::CheckUnusedActionParams(SmartScriptHolder const& e) case SMART_ACTION_SUMMON_GO: return sizeof(SmartAction::summonGO); case SMART_ACTION_KILL_UNIT: return NO_PARAMS; case SMART_ACTION_ACTIVATE_TAXI: return sizeof(SmartAction::taxi); - case SMART_ACTION_WP_START: return sizeof(SmartAction::wpStart); - case SMART_ACTION_WP_PAUSE: return sizeof(SmartAction::wpPause); - case SMART_ACTION_WP_STOP: return sizeof(SmartAction::wpStop); + case SMART_ACTION_ESCORT_START: return sizeof(SmartAction::wpStart); + case SMART_ACTION_ESCORT_PAUSE: return sizeof(SmartAction::wpPause); + case SMART_ACTION_ESCORT_STOP: return sizeof(SmartAction::wpStop); case SMART_ACTION_ADD_ITEM: return sizeof(SmartAction::item); case SMART_ACTION_REMOVE_ITEM: return sizeof(SmartAction::item); case SMART_ACTION_INSTALL_AI_TEMPLATE: return sizeof(SmartAction::installTtemplate); @@ -777,7 +779,7 @@ bool SmartAIMgr::CheckUnusedActionParams(SmartScriptHolder const& e) case SMART_ACTION_TELEPORT: return sizeof(SmartAction::teleport); case SMART_ACTION_SET_COUNTER: return sizeof(SmartAction::setCounter); case SMART_ACTION_STORE_TARGET_LIST: return sizeof(SmartAction::storeTargets); - case SMART_ACTION_WP_RESUME: return NO_PARAMS; + case SMART_ACTION_ESCORT_RESUME: return NO_PARAMS; case SMART_ACTION_SET_ORIENTATION: return sizeof(SmartAction::orientation); case SMART_ACTION_CREATE_TIMED_EVENT: return sizeof(SmartAction::timeEvent); case SMART_ACTION_PLAYMOVIE: return sizeof(SmartAction::movie); @@ -875,7 +877,7 @@ bool SmartAIMgr::CheckUnusedActionParams(SmartScriptHolder const& e) case SMART_ACTION_PLAY_SPELL_VISUAL: return sizeof(SmartAction::spellVisual); case SMART_ACTION_FOLLOW_GROUP: return sizeof(SmartAction::followGroup); case SMART_ACTION_SET_ORIENTATION_TARGET: return sizeof(SmartAction::orientationTarget); - case SMART_ACTION_WAYPOINT_DATA_START: return sizeof(SmartAction::wpData); + case SMART_ACTION_WAYPOINT_START: return sizeof(SmartAction::wpData); case SMART_ACTION_WAYPOINT_DATA_RANDOM: return sizeof(SmartAction::wpDataRandom); case SMART_ACTION_MOVEMENT_STOP: return NO_PARAMS; case SMART_ACTION_MOVEMENT_PAUSE: return sizeof(SmartAction::move); @@ -1416,19 +1418,19 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e) case SMART_EVENT_QUEST_REWARDED: case SMART_EVENT_QUEST_FAIL: case SMART_EVENT_JUST_SUMMONED: - case SMART_EVENT_WAYPOINT_START: - case SMART_EVENT_WAYPOINT_REACHED: - case SMART_EVENT_WAYPOINT_PAUSED: - case SMART_EVENT_WAYPOINT_RESUMED: - case SMART_EVENT_WAYPOINT_STOPPED: - case SMART_EVENT_WAYPOINT_ENDED: + case SMART_EVENT_ESCORT_START: + case SMART_EVENT_ESCORT_REACHED: + case SMART_EVENT_ESCORT_PAUSED: + case SMART_EVENT_ESCORT_RESUMED: + case SMART_EVENT_ESCORT_STOPPED: + case SMART_EVENT_ESCORT_ENDED: case SMART_EVENT_GOSSIP_SELECT: case SMART_EVENT_GOSSIP_HELLO: case SMART_EVENT_JUST_CREATED: case SMART_EVENT_FOLLOW_COMPLETED: case SMART_EVENT_ON_SPELLCLICK: - case SMART_EVENT_WAYPOINT_DATA_REACHED: - case SMART_EVENT_WAYPOINT_DATA_ENDED: + case SMART_EVENT_WAYPOINT_REACHED: + case SMART_EVENT_WAYPOINT_ENDED: break; default: LOG_ERROR("sql.sql", "SmartAIMgr: Not handled event_type({}), Entry {} SourceType {} Event {} Action {}, skipped.", e.GetEventType(), e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType()); @@ -1721,11 +1723,11 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e) return false; } break; - case SMART_ACTION_WP_STOP: + case SMART_ACTION_ESCORT_STOP: if (e.action.wpStop.quest && !IsQuestValid(e, e.action.wpStop.quest)) return false; return IsSAIBoolValid(e, e.action.wpStop.fail); - case SMART_ACTION_WP_START: + case SMART_ACTION_ESCORT_START: { if (!sSmartWaypointMgr->GetPath(e.action.wpStart.pathID)) { @@ -1940,7 +1942,7 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e) case SMART_ACTION_STORE_TARGET_LIST: case SMART_ACTION_COMBAT_STOP: case SMART_ACTION_DIE: - case SMART_ACTION_WP_RESUME: + case SMART_ACTION_ESCORT_RESUME: case SMART_ACTION_KILL_UNIT: case SMART_ACTION_SET_INVINCIBILITY_HP_LEVEL: case SMART_ACTION_RESET_GOBJECT: @@ -1950,7 +1952,7 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e) case SMART_ACTION_SET_INST_DATA64: case SMART_ACTION_SET_DATA: case SMART_ACTION_MOVE_FORWARD: - case SMART_ACTION_WP_PAUSE: + case SMART_ACTION_ESCORT_PAUSE: case SMART_ACTION_SET_FLY: case SMART_ACTION_FORCE_DESPAWN: case SMART_ACTION_SET_INGAME_PHASE_MASK: @@ -2020,7 +2022,7 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e) case SMART_ACTION_PLAY_SPELL_VISUAL: case SMART_ACTION_FOLLOW_GROUP: case SMART_ACTION_SET_ORIENTATION_TARGET: - case SMART_ACTION_WAYPOINT_DATA_START: + case SMART_ACTION_WAYPOINT_START: case SMART_ACTION_WAYPOINT_DATA_RANDOM: case SMART_ACTION_MOVEMENT_STOP: case SMART_ACTION_MOVEMENT_PAUSE: diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.h b/src/server/game/AI/SmartScripts/SmartScriptMgr.h index 9e6c15522..3c6fd4004 100644 --- a/src/server/game/AI/SmartScripts/SmartScriptMgr.h +++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.h @@ -26,29 +26,10 @@ #include "Optional.h" #include "SpellMgr.h" #include +#include "WaypointMgr.h" typedef uint32 SAIBool; -struct WayPoint -{ - WayPoint(uint32 _id, float _x, float _y, float _z, Optional _o, uint32 _delay) - { - id = _id; - x = _x; - y = _y; - z = _z; - o = _o; - delay = _delay; - } - - uint32 id; - float x; - float y; - float z; - std::optional o; - uint32 delay; -}; - enum eSmartAI { SMART_EVENT_PARAM_COUNT = 4, @@ -149,13 +130,13 @@ enum SMART_EVENT SMART_EVENT_SPELLHIT_TARGET = 31, // SpellID, School, CooldownMin, CooldownMax SMART_EVENT_DAMAGED = 32, // MinDmg, MaxDmg, CooldownMin, CooldownMax SMART_EVENT_DAMAGED_TARGET = 33, // MinDmg, MaxDmg, CooldownMin, CooldownMax - SMART_EVENT_MOVEMENTINFORM = 34, // MovementType(any), PointID + SMART_EVENT_MOVEMENTINFORM = 34, // MovementType(any), PointID, PathId(0 - any) SMART_EVENT_SUMMON_DESPAWNED = 35, // Entry, CooldownMin, CooldownMax SMART_EVENT_CORPSE_REMOVED = 36, // NONE SMART_EVENT_AI_INIT = 37, // NONE SMART_EVENT_DATA_SET = 38, // Id, Value, CooldownMin, CooldownMax - SMART_EVENT_WAYPOINT_START = 39, // PointId(0any), pathID(0any) - SMART_EVENT_WAYPOINT_REACHED = 40, // PointId(0any), pathID(0any) + SMART_EVENT_ESCORT_START = 39, // PointId(0any), pathID(0any) + SMART_EVENT_ESCORT_REACHED = 40, // PointId(0any), pathID(0any) SMART_EVENT_TRANSPORT_ADDPLAYER = 41, // NONE SMART_EVENT_TRANSPORT_ADDCREATURE = 42, // Entry (0 any) SMART_EVENT_TRANSPORT_REMOVE_PLAYER = 43, // NONE @@ -170,10 +151,10 @@ enum SMART_EVENT SMART_EVENT_TEXT_OVER = 52, // GroupId from creature_text, creature entry who talks (0 any) SMART_EVENT_RECEIVE_HEAL = 53, // MinHeal, MaxHeal, CooldownMin, CooldownMax SMART_EVENT_JUST_SUMMONED = 54, // none - SMART_EVENT_WAYPOINT_PAUSED = 55, // PointId(0any), pathID(0any) - SMART_EVENT_WAYPOINT_RESUMED = 56, // PointId(0any), pathID(0any) - SMART_EVENT_WAYPOINT_STOPPED = 57, // PointId(0any), pathID(0any) - SMART_EVENT_WAYPOINT_ENDED = 58, // PointId(0any), pathID(0any) + SMART_EVENT_ESCORT_PAUSED = 55, // PointId(0any), pathID(0any) + SMART_EVENT_ESCORT_RESUMED = 56, // PointId(0any), pathID(0any) + SMART_EVENT_ESCORT_STOPPED = 57, // PointId(0any), pathID(0any) + SMART_EVENT_ESCORT_ENDED = 58, // PointId(0any), pathID(0any) SMART_EVENT_TIMED_EVENT_TRIGGERED = 59, // id SMART_EVENT_UPDATE = 60, // InitialMin, InitialMax, RepeatMin, RepeatMax SMART_EVENT_LINK = 61, // INTERNAL USAGE, no params, used to link together multiple events, does not use any extra resources to iterate event lists needlessly @@ -213,8 +194,8 @@ enum SMART_EVENT SMART_EVENT_AREA_CASTING = 105, // min, max, repeatMin, repeatMax, rangeMin, rangeMax SMART_EVENT_AREA_RANGE = 106, // min, max, repeatMin, repeatMax, rangeMin, rangeMax SMART_EVENT_SUMMONED_UNIT_EVADE = 107, // CreatureId(0 all), CooldownMin, CooldownMax - SMART_EVENT_WAYPOINT_DATA_REACHED = 108, // PointId (0: any), pathId (0: any) - SMART_EVENT_WAYPOINT_DATA_ENDED = 109, // PointId (0: any), pathId (0: any) + SMART_EVENT_WAYPOINT_REACHED = 108, // PointId (0: any), pathId (0: any) + SMART_EVENT_WAYPOINT_ENDED = 109, // PointId (0: any), pathId (0: any) SMART_EVENT_IS_IN_MELEE_RANGE = 110, // min, max, repeatMin, repeatMax, dist, invert (0: false, 1: true) SMART_EVENT_AC_END = 111 @@ -356,6 +337,7 @@ struct SmartEvent { uint32 type; uint32 id; + uint32 pathId; } movementInform; struct @@ -608,9 +590,9 @@ enum SMART_ACTION SMART_ACTION_SUMMON_GO = 50, // GameObjectID, DespawnTime, targetSummon, summonType (0 time or summoner dies/1 time) SMART_ACTION_KILL_UNIT = 51, // SMART_ACTION_ACTIVATE_TAXI = 52, // TaxiID - SMART_ACTION_WP_START = 53, // run/walk, pathID, canRepeat, quest, despawntime, reactState - SMART_ACTION_WP_PAUSE = 54, // time - SMART_ACTION_WP_STOP = 55, // despawnTime, quest, fail? + SMART_ACTION_ESCORT_START = 53, // run/walk, pathID, canRepeat, quest, despawntime, reactState + SMART_ACTION_ESCORT_PAUSE = 54, // time + SMART_ACTION_ESCORT_STOP = 55, // despawnTime, quest, fail? SMART_ACTION_ADD_ITEM = 56, // itemID, count SMART_ACTION_REMOVE_ITEM = 57, // itemID, count SMART_ACTION_INSTALL_AI_TEMPLATE = 58, // AITemplateID @@ -620,7 +602,7 @@ enum SMART_ACTION SMART_ACTION_TELEPORT = 62, // mapID, SMART_ACTION_SET_COUNTER = 63, // id, value, reset (0/1) SMART_ACTION_STORE_TARGET_LIST = 64, // varID, - SMART_ACTION_WP_RESUME = 65, // none + SMART_ACTION_ESCORT_RESUME = 65, // none SMART_ACTION_SET_ORIENTATION = 66, // quick change, random orientation? (0/1), turnAngle SMART_ACTION_CREATE_TIMED_EVENT = 67, // id, InitialMin, InitialMax, RepeatMin(only if it repeats), RepeatMax(only if it repeats), chance SMART_ACTION_PLAYMOVIE = 68, // entry @@ -732,7 +714,7 @@ enum SMART_ACTION SMART_ACTION_PLAY_SPELL_VISUAL = 229, // visualId, visualIdImpact SMART_ACTION_FOLLOW_GROUP = 230, // followState, followType, dist SMART_ACTION_SET_ORIENTATION_TARGET = 231, // type, target_type, target_param1, target_param2, target_param3, target_param4 - SMART_ACTION_WAYPOINT_DATA_START = 232, // pathId, repeat + SMART_ACTION_WAYPOINT_START = 232, // pathId, repeat, pathSource SMART_ACTION_WAYPOINT_DATA_RANDOM = 233, // pathId1, pathId2, repeat SMART_ACTION_MOVEMENT_STOP = 234, // SMART_ACTION_MOVEMENT_PAUSE = 235, // timer @@ -1482,6 +1464,7 @@ struct SmartAction { uint32 pathId; SAIBool repeat; + PathSource pathSource; } wpData; struct @@ -1853,8 +1836,8 @@ const uint32 SmartAIEventMask[SMART_EVENT_AC_END][2] = {SMART_EVENT_CORPSE_REMOVED, SMART_SCRIPT_TYPE_MASK_CREATURE }, {SMART_EVENT_AI_INIT, SMART_SCRIPT_TYPE_MASK_CREATURE + SMART_SCRIPT_TYPE_MASK_GAMEOBJECT }, {SMART_EVENT_DATA_SET, SMART_SCRIPT_TYPE_MASK_CREATURE + SMART_SCRIPT_TYPE_MASK_GAMEOBJECT }, - {SMART_EVENT_WAYPOINT_START, SMART_SCRIPT_TYPE_MASK_CREATURE }, - {SMART_EVENT_WAYPOINT_REACHED, SMART_SCRIPT_TYPE_MASK_CREATURE }, + {SMART_EVENT_ESCORT_START, SMART_SCRIPT_TYPE_MASK_CREATURE }, + {SMART_EVENT_ESCORT_REACHED, SMART_SCRIPT_TYPE_MASK_CREATURE }, {SMART_EVENT_TRANSPORT_ADDPLAYER, SMART_SCRIPT_TYPE_MASK_TRANSPORT }, {SMART_EVENT_TRANSPORT_ADDCREATURE, SMART_SCRIPT_TYPE_MASK_TRANSPORT }, {SMART_EVENT_TRANSPORT_REMOVE_PLAYER, SMART_SCRIPT_TYPE_MASK_TRANSPORT }, @@ -1869,10 +1852,10 @@ const uint32 SmartAIEventMask[SMART_EVENT_AC_END][2] = {SMART_EVENT_TEXT_OVER, SMART_SCRIPT_TYPE_MASK_CREATURE + SMART_SCRIPT_TYPE_MASK_GAMEOBJECT }, {SMART_EVENT_RECEIVE_HEAL, SMART_SCRIPT_TYPE_MASK_CREATURE }, {SMART_EVENT_JUST_SUMMONED, SMART_SCRIPT_TYPE_MASK_CREATURE }, - {SMART_EVENT_WAYPOINT_PAUSED, SMART_SCRIPT_TYPE_MASK_CREATURE }, - {SMART_EVENT_WAYPOINT_RESUMED, SMART_SCRIPT_TYPE_MASK_CREATURE }, - {SMART_EVENT_WAYPOINT_STOPPED, SMART_SCRIPT_TYPE_MASK_CREATURE }, - {SMART_EVENT_WAYPOINT_ENDED, SMART_SCRIPT_TYPE_MASK_CREATURE }, + {SMART_EVENT_ESCORT_PAUSED, SMART_SCRIPT_TYPE_MASK_CREATURE }, + {SMART_EVENT_ESCORT_RESUMED, SMART_SCRIPT_TYPE_MASK_CREATURE }, + {SMART_EVENT_ESCORT_STOPPED, SMART_SCRIPT_TYPE_MASK_CREATURE }, + {SMART_EVENT_ESCORT_ENDED, SMART_SCRIPT_TYPE_MASK_CREATURE }, {SMART_EVENT_TIMED_EVENT_TRIGGERED, SMART_SCRIPT_TYPE_MASK_CREATURE + SMART_SCRIPT_TYPE_MASK_GAMEOBJECT }, {SMART_EVENT_UPDATE, SMART_SCRIPT_TYPE_MASK_CREATURE + SMART_SCRIPT_TYPE_MASK_GAMEOBJECT }, {SMART_EVENT_LINK, SMART_SCRIPT_TYPE_MASK_CREATURE + SMART_SCRIPT_TYPE_MASK_GAMEOBJECT + SMART_SCRIPT_TYPE_MASK_AREATRIGGER + SMART_SCRIPT_TYPE_MASK_EVENT + SMART_SCRIPT_TYPE_MASK_GOSSIP + SMART_SCRIPT_TYPE_MASK_QUEST + SMART_SCRIPT_TYPE_MASK_SPELL + SMART_SCRIPT_TYPE_MASK_TRANSPORT + SMART_SCRIPT_TYPE_MASK_INSTANCE }, @@ -1922,8 +1905,8 @@ const uint32 SmartAIEventMask[SMART_EVENT_AC_END][2] = {SMART_EVENT_AREA_CASTING, SMART_SCRIPT_TYPE_MASK_CREATURE }, {SMART_EVENT_AREA_RANGE, SMART_SCRIPT_TYPE_MASK_CREATURE }, {SMART_EVENT_SUMMONED_UNIT_EVADE, SMART_SCRIPT_TYPE_MASK_CREATURE + SMART_SCRIPT_TYPE_MASK_GAMEOBJECT }, - {SMART_EVENT_WAYPOINT_DATA_REACHED, SMART_SCRIPT_TYPE_MASK_CREATURE }, - {SMART_EVENT_WAYPOINT_DATA_ENDED, SMART_SCRIPT_TYPE_MASK_CREATURE }, + {SMART_EVENT_WAYPOINT_REACHED, SMART_SCRIPT_TYPE_MASK_CREATURE }, + {SMART_EVENT_WAYPOINT_ENDED, SMART_SCRIPT_TYPE_MASK_CREATURE }, {SMART_EVENT_IS_IN_MELEE_RANGE, SMART_SCRIPT_TYPE_MASK_CREATURE }, }; @@ -2010,8 +1993,6 @@ public: static constexpr uint32 DEFAULT_PRIORITY = std::numeric_limits::max(); }; -typedef std::unordered_map WPPath; - typedef std::vector ObjectVector; class ObjectGuidVector @@ -2059,7 +2040,7 @@ public: void LoadFromDB(); - WPPath* GetPath(uint32 id) + WaypointPath* GetPath(uint32 id) { if (waypoint_map.find(id) != waypoint_map.end()) return waypoint_map[id]; @@ -2067,7 +2048,7 @@ public: } private: - std::unordered_map waypoint_map; + std::unordered_map waypoint_map; }; // all events for a single entry diff --git a/src/server/game/Movement/MotionMaster.cpp b/src/server/game/Movement/MotionMaster.cpp index c229abdbc..d33de5187 100644 --- a/src/server/game/Movement/MotionMaster.cpp +++ b/src/server/game/Movement/MotionMaster.cpp @@ -32,6 +32,7 @@ #include "TargetedMovementGenerator.h" #include "WaypointMgr.h" #include "WaypointMovementGenerator.h" +#include "SmartScriptMgr.h" inline MovementGenerator* GetIdleMovementGenerator() { @@ -503,19 +504,35 @@ void MotionMaster::MoveSplinePath(Movement::PointsArray* path, ForcedMovement fo } } -void MotionMaster::MoveSplinePath(uint32 path_id, ForcedMovement forcedMovement) +void MotionMaster::MovePath(uint32 path_id, ForcedMovement forcedMovement, PathSource pathSource) { - // convert the path id to a Movement::PointsArray* - Movement::PointsArray* points = new Movement::PointsArray(); - WaypointPath const* path = sWaypointMgr->GetPath(path_id); - for (uint8 i = 0; i < path->size(); ++i) + WaypointPath const* path; + switch (pathSource) { - WaypointData const* node = path->at(i); - points->push_back(G3D::Vector3(node->x, node->y, node->z)); + default: + case PathSource::WAYPOINT_MGR: + path = sWaypointMgr->GetPath(path_id); + break; + case PathSource::SMART_WAYPOINT_MGR: + path = sSmartWaypointMgr->GetPath(path_id); + break; + } + + if (path == nullptr) + { + LOG_ERROR("sql.sql", "WaypointMovementGenerator::LoadPath: creature {} ({}) doesn't have waypoint path id: {} pathSource: {}", + _owner->GetName(), _owner->GetGUID().ToString(), path_id, pathSource); + return; + } + + Movement::PointsArray points; + for (auto& point : *path) + { + points.push_back(G3D::Vector3(point.second.x, point.second.y, point.second.z)); } // pass the new PointsArray* to the appropriate MoveSplinePath function - MoveSplinePath(points, forcedMovement); + MoveSplinePath(&points, forcedMovement); } /** @@ -881,7 +898,7 @@ void MotionMaster::Mutate(MovementGenerator* m, MovementSlot slot) /** * @brief Move the unit following a specific path. Doesn't work with UNIT_FLAG_DISABLE_MOVE */ -void MotionMaster::MovePath(uint32 path_id, bool repeatable) +void MotionMaster::MoveWaypoint(uint32 path_id, bool repeatable, PathSource pathSource) { if (!path_id) return; @@ -889,20 +906,7 @@ void MotionMaster::MovePath(uint32 path_id, bool repeatable) if (_owner->HasUnitFlag(UNIT_FLAG_DISABLE_MOVE)) return; - //We set waypoint movement as new default movement generator - // clear ALL movement generators (including default) - /*while (!empty()) - { - MovementGenerator *curr = top(); - curr->Finalize(*_owner); - pop(); - if (!isStatic(curr)) - delete curr; - }*/ - - //_owner->IsPlayer() ? - //Mutate(new WaypointMovementGenerator(path_id, repeatable)): - Mutate(new WaypointMovementGenerator(path_id, repeatable), MOTION_SLOT_IDLE); + Mutate(new WaypointMovementGenerator(path_id, pathSource, repeatable), MOTION_SLOT_IDLE); LOG_DEBUG("movement.motionmaster", "{} ({}) start moving over path(Id:{}, repeatable: {})", _owner->IsPlayer() ? "Player" : "Creature", _owner->GetGUID().ToString(), path_id, repeatable ? "YES" : "NO"); diff --git a/src/server/game/Movement/MotionMaster.h b/src/server/game/Movement/MotionMaster.h index bc4cc996b..319da8d57 100644 --- a/src/server/game/Movement/MotionMaster.h +++ b/src/server/game/Movement/MotionMaster.h @@ -89,6 +89,12 @@ enum ForcedMovement FORCED_MOVEMENT_MAX }; +enum class PathSource +{ + WAYPOINT_MGR = 0, + SMART_WAYPOINT_MGR = 1, +}; + struct ChaseRange { ChaseRange(float range); @@ -223,7 +229,7 @@ public: { MovePoint(id, pos.m_positionX, pos.m_positionY, pos.m_positionZ, forcedMovement, speed, pos.GetOrientation(), generatePath, forceDestination, MOTION_SLOT_ACTIVE); } void MovePoint(uint32 id, float x, float y, float z, ForcedMovement forcedMovement = FORCED_MOVEMENT_NONE, float speed = 0.f, float orientation = 0.0f, bool generatePath = true, bool forceDestination = true, MovementSlot slot = MOTION_SLOT_ACTIVE); void MoveSplinePath(Movement::PointsArray* path, ForcedMovement forcedMovement = FORCED_MOVEMENT_NONE); - void MoveSplinePath(uint32 path_id, ForcedMovement forcedMovement = FORCED_MOVEMENT_NONE); + void MovePath(uint32 path_id, ForcedMovement forcedMovement = FORCED_MOVEMENT_NONE, PathSource pathSource = PathSource::WAYPOINT_MGR); // These two movement types should only be used with creatures having landing/takeoff animations void MoveLand(uint32 id, Position const& pos, float speed = 0.0f); @@ -244,7 +250,7 @@ public: void MoveSeekAssistanceDistract(uint32 timer); void MoveTaxiFlight(uint32 path, uint32 pathnode); void MoveDistract(uint32 time); - void MovePath(uint32 path_id, bool repeatable); + void MoveWaypoint(uint32 path_id, bool repeatable, PathSource pathSource = PathSource::WAYPOINT_MGR); void MoveRotate(uint32 time, RotateDirection direction); [[nodiscard]] MovementGeneratorType GetCurrentMovementGeneratorType() const; diff --git a/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp index ce93e485b..e2eb0aab7 100644 --- a/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp @@ -28,13 +28,26 @@ #include "Spell.h" #include "Transport.h" #include "World.h" +#include "SmartScriptMgr.h" void WaypointMovementGenerator::LoadPath(Creature* creature) { - if (!path_id) - path_id = creature->GetWaypointPath(); + switch (i_pathSource) + { + case PathSource::WAYPOINT_MGR: + { + if (!path_id) + path_id = creature->GetWaypointPath(); - i_path = sWaypointMgr->GetPath(path_id); + i_path = sWaypointMgr->GetPath(path_id); + break; + } + case PathSource::SMART_WAYPOINT_MGR: + { + i_path = sSmartWaypointMgr->GetPath(path_id); + break; + } + } if (!i_path) { @@ -44,6 +57,8 @@ void WaypointMovementGenerator::LoadPath(Creature* creature) return; } + i_currentNode = i_path->begin()->first; + StartMoveNow(creature); } @@ -78,22 +93,24 @@ void WaypointMovementGenerator::OnArrived(Creature* creature) creature->ClearUnitState(UNIT_STATE_ROAMING_MOVE); m_isArrivalDone = true; - if (i_path->at(i_currentNode)->event_id && urand(0, 99) < i_path->at(i_currentNode)->event_chance) + auto currentNodeItr = i_path->find(i_currentNode); + + if (currentNodeItr->second.event_id && urand(0, 99) < currentNodeItr->second.event_chance) { LOG_DEBUG("maps.script", "Creature movement start script {} at point {} for {}.", - i_path->at(i_currentNode)->event_id, i_currentNode, creature->GetGUID().ToString()); + currentNodeItr->second.event_id, i_currentNode, creature->GetGUID().ToString()); creature->ClearUnitState(UNIT_STATE_ROAMING_MOVE); - creature->GetMap()->ScriptsStart(sWaypointScripts, i_path->at(i_currentNode)->event_id, creature, nullptr); + creature->GetMap()->ScriptsStart(sWaypointScripts, currentNodeItr->second.event_id, creature, nullptr); } // Inform script MovementInform(creature); creature->UpdateWaypointID(i_currentNode); - if (i_path->at(i_currentNode)->delay) + if (currentNodeItr->second.delay) { creature->ClearUnitState(UNIT_STATE_ROAMING_MOVE); - Stop(i_path->at(i_currentNode)->delay); + Stop(currentNodeItr->second.delay); } } @@ -116,9 +133,10 @@ bool WaypointMovementGenerator::StartMove(Creature* creature) // Xinef: not true... update this at every waypoint! //if ((i_currentNode == i_path->size() - 1) && !repeating) // If that's our last waypoint { - float x = i_path->at(i_currentNode)->x; - float y = i_path->at(i_currentNode)->y; - float z = i_path->at(i_currentNode)->z; + auto currentNodeItr = i_path->find(i_currentNode); + float x = currentNodeItr->second.x; + float y = currentNodeItr->second.y; + float z = currentNodeItr->second.z; float o = creature->GetOrientation(); if (!transportPath) @@ -146,7 +164,9 @@ bool WaypointMovementGenerator::StartMove(Creature* creature) return false; } - i_currentNode = (i_currentNode + 1) % i_path->size(); + ++i_currentNode; + if (i_path->rbegin()->first < i_currentNode) + i_currentNode = i_path->begin()->first; } // xinef: do not initialize motion if we got stunned in movementinform @@ -155,13 +175,14 @@ bool WaypointMovementGenerator::StartMove(Creature* creature) return true; } - WaypointData const* node = i_path->at(i_currentNode); + auto currentNodeItr = i_path->find(i_currentNode); + WaypointData const& node = currentNodeItr->second; m_isArrivalDone = false; creature->AddUnitState(UNIT_STATE_ROAMING_MOVE); - Movement::Location formationDest(node->x, node->y, node->z, 0.0f); + Movement::Location formationDest(node.x, node.y, node.z, 0.0f); Movement::MoveSplineInit init(creature); //! If creature is on transport, we assume waypoints set in DB are already transport offsets @@ -172,16 +193,16 @@ bool WaypointMovementGenerator::StartMove(Creature* creature) trans->CalculatePassengerPosition(formationDest.x, formationDest.y, formationDest.z, &formationDest.orientation); } - float z = node->z; - creature->UpdateAllowedPositionZ(node->x, node->y, z); + float z = node.z; + creature->UpdateAllowedPositionZ(node.x, node.y, z); //! Do not use formationDest here, MoveTo requires transport offsets due to DisableTransportPathTransformations() call //! but formationDest contains global coordinates - init.MoveTo(node->x, node->y, z, true, true); + init.MoveTo(node.x, node.y, z, true, true); - if (node->orientation.has_value() && node->delay > 0) - init.SetFacing(*node->orientation); + if (node.orientation.has_value() && node.delay > 0) + init.SetFacing(*node.orientation); - switch (node->move_type) + switch (node.move_type) { case WAYPOINT_MOVE_TYPE_LAND: init.SetAnimation(Movement::ToGround); @@ -203,7 +224,7 @@ bool WaypointMovementGenerator::StartMove(Creature* creature) //Call for creature group update if (creature->GetFormation() && creature->GetFormation()->GetLeader() == creature) - creature->GetFormation()->LeaderMoveTo(formationDest.x, formationDest.y, formationDest.z, node->move_type); + creature->GetFormation()->LeaderMoveTo(formationDest.x, formationDest.y, formationDest.z, node.move_type); return true; } diff --git a/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.h b/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.h index 3161894a2..babc16cb4 100644 --- a/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.h +++ b/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.h @@ -54,8 +54,8 @@ class WaypointMovementGenerator : public MovementGeneratorMedium< Crea public PathMovementBase { public: - WaypointMovementGenerator(uint32 _path_id = 0, bool _repeating = true, bool _stalled = false) - : PathMovementBase((WaypointPath const*)nullptr), i_nextMoveTime(0), m_isArrivalDone(false), path_id(_path_id), repeating(_repeating), stalled(_stalled) {} + WaypointMovementGenerator(uint32 _path_id = 0, PathSource pathSource = PathSource::WAYPOINT_MGR, bool _repeating = true, bool _stalled = false) + : PathMovementBase((WaypointPath const*)nullptr), i_nextMoveTime(0), m_isArrivalDone(false), path_id(_path_id), repeating(_repeating), stalled(_stalled), i_pathSource(pathSource) {} ~WaypointMovementGenerator() { i_path = nullptr; } void DoInitialize(Creature*); void DoFinalize(Creature*); @@ -96,6 +96,7 @@ private: uint32 path_id; bool repeating; bool stalled; + PathSource i_pathSource; }; /** FlightPathMovementGenerator generates movement of the player for the paths diff --git a/src/server/game/Movement/Waypoints/WaypointMgr.cpp b/src/server/game/Movement/Waypoints/WaypointMgr.cpp index 7a2596fbf..076fb39d5 100644 --- a/src/server/game/Movement/Waypoints/WaypointMgr.cpp +++ b/src/server/game/Movement/Waypoints/WaypointMgr.cpp @@ -30,9 +30,6 @@ WaypointMgr::~WaypointMgr() { for (WaypointPathContainer::iterator itr = _waypointStore.begin(); itr != _waypointStore.end(); ++itr) { - for (WaypointPath::const_iterator it = itr->second.begin(); it != itr->second.end(); ++it) - delete *it; - itr->second.clear(); } @@ -64,7 +61,7 @@ void WaypointMgr::Load() do { Field* fields = result->Fetch(); - WaypointData* wp = new WaypointData(); + WaypointData data; uint32 pathId = fields[0].Get(); WaypointPath& path = _waypointStore[pathId]; @@ -79,28 +76,40 @@ void WaypointMgr::Load() Acore::NormalizeMapCoord(x); Acore::NormalizeMapCoord(y); - wp->id = fields[1].Get(); - wp->x = x; - wp->y = y; - wp->z = z; - wp->orientation = o; - wp->move_type = fields[6].Get(); + data.id = fields[1].Get(); + data.x = x; + data.y = y; + data.z = z; + data.orientation = o; + data.move_type = fields[6].Get(); - if (wp->move_type >= WAYPOINT_MOVE_TYPE_MAX) + if (data.move_type >= WAYPOINT_MOVE_TYPE_MAX) { //LOG_ERROR("sql.sql", "Waypoint {} in waypoint_data has invalid move_type, ignoring", wp->id); - delete wp; continue; } - wp->delay = fields[7].Get(); - wp->event_id = fields[8].Get(); - wp->event_chance = fields[9].Get(); + data.delay = fields[7].Get(); + data.event_id = fields[8].Get(); + data.event_chance = fields[9].Get(); - path.push_back(wp); + path.emplace(data.id, data); ++count; } while (result->NextRow()); + for (auto itr = _waypointStore.begin(); itr != _waypointStore.end(); ) + { + uint32 first = itr->second.begin()->first; + uint32 last = itr->second.rbegin()->first; + if (last - first + 1 != itr->second.size()) + { + LOG_ERROR("sql.sql", "Waypoint {} in waypoint_data has non-contiguous pointids, skipping", itr->first); + itr = _waypointStore.erase(itr); + } + else + ++itr; + } + LOG_INFO("server.loading", ">> Loaded {} waypoints in {} ms", count, GetMSTimeDiffToNow(oldMSTime)); LOG_INFO("server.loading", " "); } @@ -110,9 +119,6 @@ void WaypointMgr::ReloadPath(uint32 id) WaypointPathContainer::iterator itr = _waypointStore.find(id); if (itr != _waypointStore.end()) { - for (WaypointPath::const_iterator it = itr->second.begin(); it != itr->second.end(); ++it) - delete *it; - _waypointStore.erase(itr); } @@ -130,7 +136,7 @@ void WaypointMgr::ReloadPath(uint32 id) do { Field* fields = result->Fetch(); - WaypointData* wp = new WaypointData(); + WaypointData data; float x = fields[1].Get(); float y = fields[2].Get(); @@ -142,24 +148,23 @@ void WaypointMgr::ReloadPath(uint32 id) Acore::NormalizeMapCoord(x); Acore::NormalizeMapCoord(y); - wp->id = fields[0].Get(); - wp->x = x; - wp->y = y; - wp->z = z; - wp->orientation = o; - wp->move_type = fields[5].Get(); + data.id = fields[0].Get(); + data.x = x; + data.y = y; + data.z = z; + data.orientation = o; + data.move_type = fields[5].Get(); - if (wp->move_type >= WAYPOINT_MOVE_TYPE_MAX) + if (data.move_type >= WAYPOINT_MOVE_TYPE_MAX) { //LOG_ERROR("sql.sql", "Waypoint {} in waypoint_data has invalid move_type, ignoring", wp->id); - delete wp; continue; } - wp->delay = fields[6].Get(); - wp->event_id = fields[7].Get(); - wp->event_chance = fields[8].Get(); + data.delay = fields[6].Get(); + data.event_id = fields[7].Get(); + data.event_chance = fields[8].Get(); - path.push_back(wp); + path.emplace(data.id, data); } while (result->NextRow()); } diff --git a/src/server/game/Movement/Waypoints/WaypointMgr.h b/src/server/game/Movement/Waypoints/WaypointMgr.h index ea588a28c..6e97ab344 100644 --- a/src/server/game/Movement/Waypoints/WaypointMgr.h +++ b/src/server/game/Movement/Waypoints/WaypointMgr.h @@ -22,6 +22,7 @@ #include #include #include +#include enum WaypointMoveType { @@ -39,12 +40,12 @@ struct WaypointData float x, y, z; std::optional orientation; uint32 delay; - uint32 event_id; - uint32 move_type; - uint8 event_chance; + uint32 event_id = 0; + uint32 move_type = 0; + uint8 event_chance = 0; }; -typedef std::vector WaypointPath; +typedef std::map WaypointPath; typedef std::unordered_map WaypointPathContainer; class WaypointMgr diff --git a/src/server/game/Scripting/MapScripts.cpp b/src/server/game/Scripting/MapScripts.cpp index 8f9184da9..70ef8e4fd 100644 --- a/src/server/game/Scripting/MapScripts.cpp +++ b/src/server/game/Scripting/MapScripts.cpp @@ -767,7 +767,7 @@ void Map::ScriptsProcess() if (!sWaypointMgr->GetPath(step.script->LoadPath.PathID)) LOG_ERROR("maps.script", "{} source object has an invalid path ({}), skipping.", step.script->GetDebugInfo(), step.script->LoadPath.PathID); else - unit->GetMotionMaster()->MovePath(step.script->LoadPath.PathID, step.script->LoadPath.IsRepeatable); + unit->GetMotionMaster()->MoveWaypoint(step.script->LoadPath.PathID, step.script->LoadPath.IsRepeatable); } break; @@ -888,7 +888,7 @@ void Map::ScriptsProcess() cSource->GetMotionMaster()->MoveRandom((float)step.script->Movement.MovementDistance); break; case WAYPOINT_MOTION_TYPE: - cSource->GetMotionMaster()->MovePath(step.script->Movement.Path, false); + cSource->GetMotionMaster()->MoveWaypoint(step.script->Movement.Path, false); break; } } diff --git a/src/server/game/World/WorldState.cpp b/src/server/game/World/WorldState.cpp index b22c0de6a..d715950d2 100644 --- a/src/server/game/World/WorldState.cpp +++ b/src/server/game/World/WorldState.cpp @@ -1778,7 +1778,7 @@ bool WorldState::SummonPallid(Map* map, ScourgeInvasionData::CityAttack& zone, c else pathID = spawnLoc == 0 ? PATH_STORMWIND_KEEP : PATH_STORMWIND_TRADE_DISTRICT; - pallid->GetMotionMaster()->MovePath(pathID, false); + pallid->GetMotionMaster()->MoveWaypoint(pathID, false); sWorldState->SetPallidGuid(zone.zoneId, pallid->GetGUID()); } diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_gyth.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_gyth.cpp index fc49d131f..f7bf1b5a5 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_gyth.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_gyth.cpp @@ -128,7 +128,7 @@ public: events.ScheduleEvent(EVENT_SUMMONED_2, 2s); break; case EVENT_SUMMONED_2: - me->GetMotionMaster()->MovePath(GYTH_PATH_1, false); + me->GetMotionMaster()->MoveWaypoint(GYTH_PATH_1, false); break; default: break; 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 82e19a694..366622029 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_rend_blackhand.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_rend_blackhand.cpp @@ -362,10 +362,10 @@ public: break; case EVENT_PATH_NEFARIUS: if (Creature* victor = ObjectAccessor::GetCreature(*me, victorGUID)) - victor->GetMotionMaster()->MovePath(NEFARIUS_PATH_1, true); + victor->GetMotionMaster()->MoveWaypoint(NEFARIUS_PATH_1, true); break; case EVENT_PATH_REND: - me->GetMotionMaster()->MovePath(REND_PATH_1, false); + me->GetMotionMaster()->MoveWaypoint(REND_PATH_1, false); break; case EVENT_TELEPORT_1: me->NearTeleportTo(194.2993f, -474.0814f, 121.4505f, -0.01225555f); 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 b08470c02..fe9d0a981 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_the_beast.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_the_beast.cpp @@ -110,7 +110,7 @@ public: if (_beastReached) { - me->GetMotionMaster()->MovePath(BEAST_MOVEMENT_ID, true); + me->GetMotionMaster()->MoveWaypoint(BEAST_MOVEMENT_ID, true); } } @@ -169,7 +169,7 @@ public: if (!_beastReached) { _beastReached = true; - me->GetMotionMaster()->MovePath(BEAST_MOVEMENT_ID, true); + me->GetMotionMaster()->MoveWaypoint(BEAST_MOVEMENT_ID, true); // There is a chance player logged in between areatriggers (realm crash or restart) // executing part of script which happens when player enters boss room diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_chromaggus.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_chromaggus.cpp index 873cfdc74..fc8368f1b 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_chromaggus.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_chromaggus.cpp @@ -244,7 +244,7 @@ class go_chromaggus_lever : public GameObjectScript if (Creature* creature = _instance->GetCreature(DATA_CHROMAGGUS)) { creature->SetHomePosition(homePos); - creature->GetMotionMaster()->MovePath(creature->GetEntry() * 10, false); + creature->GetMotionMaster()->MoveWaypoint(creature->GetEntry() * 10, false); creature->AI()->SetGUID(player->GetGUID(), GUID_LEVER_USER); } diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_nefarian.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_nefarian.cpp index 712f9c5a2..96a97a1ec 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_nefarian.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_nefarian.cpp @@ -343,7 +343,7 @@ public: nefarian->setActive(true); nefarian->SetCanFly(true); nefarian->SetDisableGravity(true); - nefarian->GetMotionMaster()->MovePath(NEFARIAN_PATH, false); + nefarian->GetMotionMaster()->MoveWaypoint(NEFARIAN_PATH, false); } events.Reset(); @@ -406,7 +406,7 @@ public: switch (eventId) { case EVENT_PATH_2: - me->GetMotionMaster()->MovePath(NEFARIUS_PATH_2, false); + me->GetMotionMaster()->MoveWaypoint(NEFARIUS_PATH_2, false); events.ScheduleEvent(EVENT_CHAOS_1, 7s); break; case EVENT_CHAOS_1: @@ -438,7 +438,7 @@ public: me->DespawnOrUnsummon(1s); break; case EVENT_PATH_3: - me->GetMotionMaster()->MovePath(NEFARIUS_PATH_3, false); + me->GetMotionMaster()->MoveWaypoint(NEFARIUS_PATH_3, false); break; case EVENT_START_EVENT: BeginEvent(); diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_nightbane.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_nightbane.cpp index 70bcad38e..e62ad33e5 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/boss_nightbane.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_nightbane.cpp @@ -183,7 +183,7 @@ struct boss_nightbane : public BossAI me->GetMotionMaster()->MoveTakeoff(POINT_INTRO_TAKE_OFF, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ() + 10.0f, 13.99879f); }).Schedule(4s, [this](TaskContext /*context*/) { - me->GetMotionMaster()->MovePath(me->GetEntry()*10, false); + me->GetMotionMaster()->MoveWaypoint(me->GetEntry()*10, false); }); } } @@ -400,7 +400,7 @@ struct boss_nightbane : public BossAI { scheduler.Schedule(0s, [this](TaskContext /*context*/) { - me->GetMotionMaster()->MovePath(me->GetEntry()*10+1, false); + me->GetMotionMaster()->MoveWaypoint(me->GetEntry()*10+1, false); }); } break; diff --git a/src/server/scripts/EasternKingdoms/MagistersTerrace/instance_magisters_terrace.cpp b/src/server/scripts/EasternKingdoms/MagistersTerrace/instance_magisters_terrace.cpp index eacc69548..521743897 100644 --- a/src/server/scripts/EasternKingdoms/MagistersTerrace/instance_magisters_terrace.cpp +++ b/src/server/scripts/EasternKingdoms/MagistersTerrace/instance_magisters_terrace.cpp @@ -80,7 +80,7 @@ public: { if (Creature* kalecgos = instance->SummonCreature(NPC_KALECGOS, KalecgosSpawnPos)) { - kalecgos->GetMotionMaster()->MovePath(PATH_KALECGOS_FLIGHT, false); + kalecgos->GetMotionMaster()->MoveWaypoint(PATH_KALECGOS_FLIGHT, false); kalecgos->AI()->Talk(SAY_KALECGOS_SPAWN); } }); diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp index 5a1c4218b..7b3dd97e5 100644 --- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp @@ -106,7 +106,7 @@ public: Talk(SAY_BREAKOUT0); me->m_Events.AddEventAtOffset([&] { - me->GetMotionMaster()->MovePath(me->GetEntry() * 10, false); + me->GetMotionMaster()->MoveWaypoint(me->GetEntry() * 10, false); }, 5s); } @@ -167,13 +167,13 @@ public: } if (Creature* acolyte = me->SummonCreature(NPC_CRIMSON_ACOLYTE, 1640.6724f, -6032.0527f, 134.82213f, 4.654973506927490234f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000)) - acolyte->GetMotionMaster()->MovePath(NPC_CRIMSON_ACOLYTE * 10, false); + acolyte->GetMotionMaster()->MoveWaypoint(NPC_CRIMSON_ACOLYTE * 10, false); if (Creature* acolyte = me->SummonCreature(NPC_CRIMSON_ACOLYTE, 1641.0055f, -6031.893f, 134.82211f, 0.401425719261169433f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000)) - acolyte->GetMotionMaster()->MovePath((NPC_CRIMSON_ACOLYTE + 1) * 10, false); + acolyte->GetMotionMaster()->MoveWaypoint((NPC_CRIMSON_ACOLYTE + 1) * 10, false); if (Creature* acolyte = me->SummonCreature(NPC_CRIMSON_ACOLYTE, 1639.7053f, -6031.7373f, 134.82213f, 2.443460941314697265f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000)) - acolyte->GetMotionMaster()->MovePath((NPC_CRIMSON_ACOLYTE + 2) * 10, false); + acolyte->GetMotionMaster()->MoveWaypoint((NPC_CRIMSON_ACOLYTE + 2) * 10, false); break; case 1: Talk(SAY_BREAKOUT4); @@ -182,13 +182,13 @@ public: valroth->AI()->Talk(SAY_VALROTH_WAVE2); if (Creature* acolyte = me->SummonCreature(NPC_CRIMSON_ACOLYTE, 1640.7958f, -6030.307f, 134.82211f, 4.65355682373046875f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000)) - acolyte->GetMotionMaster()->MovePath((NPC_CRIMSON_ACOLYTE + 3) * 10, false); + acolyte->GetMotionMaster()->MoveWaypoint((NPC_CRIMSON_ACOLYTE + 3) * 10, false); if (Creature* acolyte = me->SummonCreature(NPC_CRIMSON_ACOLYTE, 1641.7305f, -6030.751f, 134.82211f, 6.143558979034423828f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000)) - acolyte->GetMotionMaster()->MovePath((NPC_CRIMSON_ACOLYTE + 4) * 10, false); + acolyte->GetMotionMaster()->MoveWaypoint((NPC_CRIMSON_ACOLYTE + 4) * 10, false); if (Creature* acolyte = me->SummonCreature(NPC_CRIMSON_ACOLYTE, 1639.4657f, -6030.404f, 134.82211f, 4.502949237823486328f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000)) - acolyte->GetMotionMaster()->MovePath((NPC_CRIMSON_ACOLYTE + 5) * 10, false); + acolyte->GetMotionMaster()->MoveWaypoint((NPC_CRIMSON_ACOLYTE + 5) * 10, false); break; case 2: Talk(SAY_BREAKOUT5); @@ -197,16 +197,16 @@ public: valroth->AI()->Talk(SAY_VALROTH_WAVE3); if (Creature* acolyte = me->SummonCreature(NPC_CRIMSON_ACOLYTE, 1641.3405f, -6031.436f, 134.82211f, 4.612849712371826171f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000)) - acolyte->GetMotionMaster()->MovePath((NPC_CRIMSON_ACOLYTE + 6) * 10, false); + acolyte->GetMotionMaster()->MoveWaypoint((NPC_CRIMSON_ACOLYTE + 6) * 10, false); if (Creature* acolyte = me->SummonCreature(NPC_CRIMSON_ACOLYTE, 1642.0404f, -6030.3843f, 134.82211f, 1.378810048103332519f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000)) - acolyte->GetMotionMaster()->MovePath((NPC_CRIMSON_ACOLYTE + 7) * 10, false); + acolyte->GetMotionMaster()->MoveWaypoint((NPC_CRIMSON_ACOLYTE + 7) * 10, false); if (Creature* acolyte = me->SummonCreature(NPC_CRIMSON_ACOLYTE, 1640.1162f, -6029.7817f, 134.82211f, 5.707226753234863281f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000)) - acolyte->GetMotionMaster()->MovePath((NPC_CRIMSON_ACOLYTE + 8) * 10, false); + acolyte->GetMotionMaster()->MoveWaypoint((NPC_CRIMSON_ACOLYTE + 8) * 10, false); if (Creature* acolyte = me->SummonCreature(NPC_CRIMSON_ACOLYTE, 1640.9948f, -6029.8027f, 134.82211f, 1.605702877044677734f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000)) - acolyte->GetMotionMaster()->MovePath((NPC_CRIMSON_ACOLYTE + 9) * 10, false); + acolyte->GetMotionMaster()->MoveWaypoint((NPC_CRIMSON_ACOLYTE + 9) * 10, false); break; case 3: Talk(SAY_BREAKOUT6); @@ -223,7 +223,7 @@ public: { valroth->AI()->Talk(SAY_VALROTH_AGGRO); valroth->SetReactState(REACT_AGGRESSIVE); - valroth->GetMotionMaster()->MovePath(NPC_HIGH_INQUISITOR_VALROTH * 10, false); + valroth->GetMotionMaster()->MoveWaypoint(NPC_HIGH_INQUISITOR_VALROTH * 10, false); } return; default: @@ -262,7 +262,7 @@ public: SetInvincibility(true); me->SetReactState(REACT_PASSIVE); me->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_NPC); - me->GetMotionMaster()->MovePath((me->GetEntry() + 1) * 10, false); + me->GetMotionMaster()->MoveWaypoint((me->GetEntry() + 1) * 10, false); }); } } @@ -610,7 +610,7 @@ public: // Start waypoint movement using WaypointMovementGenerator if (uint32 pathId = me->GetWaypointPath()) { - me->GetMotionMaster()->MovePath(pathId, true); // true = repeatable + me->GetMotionMaster()->MoveWaypoint(pathId, true); // true = repeatable } // Schedule the first ritual after 20-30s events.ScheduleEvent(EVENT_START_RITUAL, 20s, 30s); @@ -797,7 +797,7 @@ public: // Start waypoint movement using WaypointMovementGenerator if (uint32 pathId = me->GetWaypointPath()) { - me->GetMotionMaster()->MovePath(pathId, true); // true = repeatable + me->GetMotionMaster()->MoveWaypoint(pathId, true); // true = repeatable } // Schedule the first ritual after 50-60s events.ScheduleEvent(EVENT_START_RITUAL, 50s, 60s); diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp index bf307fe0c..9e481aee9 100644 --- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp @@ -504,7 +504,7 @@ public: tirion->AI()->Talk(SAY_LIGHT_OF_DAWN25, 4s); tirion->m_Events.AddEventAtOffset([&, tirion] { - tirion->GetMotionMaster()->MovePath(NPC_HIGHLORD_TIRION_FORDRING * 10, false); + tirion->GetMotionMaster()->MoveWaypoint(NPC_HIGHLORD_TIRION_FORDRING * 10, false); }, 14s); events.Reset(); diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_kirtonos_the_herald.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_kirtonos_the_herald.cpp index 4634ead0e..cc38dd488 100644 --- a/src/server/scripts/EasternKingdoms/Scholomance/boss_kirtonos_the_herald.cpp +++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_kirtonos_the_herald.cpp @@ -139,7 +139,7 @@ public: switch (events2.ExecuteEvent()) { case INTRO_1: - me->GetMotionMaster()->MovePath(KIRTONOS_PATH, false); + me->GetMotionMaster()->MoveWaypoint(KIRTONOS_PATH, false); Talk(EMOTE_SUMMONED); break; case INTRO_2: diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_felmyst.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_felmyst.cpp index 04fa2023d..75ee7dd05 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_felmyst.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_felmyst.cpp @@ -157,7 +157,7 @@ struct boss_felmyst : public BossAI me->SetCanFly(true); me->SetDisableGravity(true); me->SendMovementFlagUpdate(); - me->GetMotionMaster()->MovePath(me->GetEntry() * 10, true); + me->GetMotionMaster()->MoveWaypoint(me->GetEntry() * 10, true); } } @@ -363,7 +363,7 @@ struct boss_felmyst : public BossAI me->m_Events.AddEventAtOffset([&] { me->SetImmuneToPC(false); - me->GetMotionMaster()->MovePath(me->GetEntry() * 10, true); + me->GetMotionMaster()->MoveWaypoint(me->GetEntry() * 10, true); }, 8500ms); }); } diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_nalorakk.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_nalorakk.cpp index 22c405ed6..91cbfb02a 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/boss_nalorakk.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_nalorakk.cpp @@ -127,7 +127,7 @@ struct boss_nalorakk : public BossAI { _introScheduler.CancelGroup(GROUP_CHECK_DEAD); _waveList.clear(); - me->GetMotionMaster()->MovePath(me->GetEntry()*100+1, false); + me->GetMotionMaster()->MoveWaypoint(me->GetEntry()*100+1, false); Talk(SAY_RUN_AWAY); _introScheduler.Schedule(5s, [this](TaskContext) { @@ -153,7 +153,7 @@ struct boss_nalorakk : public BossAI _introScheduler.CancelGroup(GROUP_CHECK_DEAD); _waveList.clear(); Talk(SAY_RUN_AWAY); - me->GetMotionMaster()->MovePath(me->GetEntry()*100+2, false); + me->GetMotionMaster()->MoveWaypoint(me->GetEntry()*100+2, false); _introScheduler.Schedule(6s, [this](TaskContext) { me->SetFacingTo(1.54f); @@ -176,7 +176,7 @@ struct boss_nalorakk : public BossAI _introScheduler.CancelGroup(GROUP_CHECK_DEAD); _waveList.clear(); Talk(SAY_RUN_AWAY); - me->GetMotionMaster()->MovePath(me->GetEntry() * 100 + 3, false); + me->GetMotionMaster()->MoveWaypoint(me->GetEntry() * 100 + 3, false); _introScheduler.Schedule(6s, [this](TaskContext) { me->SetFacingTo(1.54f); diff --git a/src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp b/src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp index 4b28c85fe..942761c4c 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp @@ -400,7 +400,7 @@ struct npc_harrison_jones : public ScriptedAI Talk(SAY_HARRISON_0); scheduler.Schedule(2s, [this](TaskContext /*task*/) { - me->GetMotionMaster()->MovePath(HARRISON_MOVE_1, false); + me->GetMotionMaster()->MoveWaypoint(HARRISON_MOVE_1, false); }); } } @@ -448,7 +448,7 @@ struct npc_harrison_jones : public ScriptedAI // Players are Now Saved to instance at SPECIAL (Player should be notified?) scheduler.Schedule(500ms, [this](TaskContext /*task*/) { - me->GetMotionMaster()->MovePath(HARRISON_MOVE_2, false); + me->GetMotionMaster()->MoveWaypoint(HARRISON_MOVE_2, false); }); } } @@ -521,7 +521,7 @@ struct npc_harrison_jones : public ScriptedAI { DoCastSelf(SPELL_STEALTH); me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_NONE); - me->GetMotionMaster()->MovePath(HARRISON_MOVE_3, false); + me->GetMotionMaster()->MoveWaypoint(HARRISON_MOVE_3, false); }); } } @@ -592,7 +592,7 @@ struct npc_amanishi_lookout : public NullCreatureAI Talk(SAY_INVADERS); me->SetUnitFlag(UNIT_FLAG_IMMUNE_TO_PC); me->SetUnitFlag(UNIT_FLAG_RENAME); - me->GetMotionMaster()->MovePath(PATH_LOOKOUT, false); + me->GetMotionMaster()->MoveWaypoint(PATH_LOOKOUT, false); } } diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_gahzranka.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_gahzranka.cpp index 1b8d13bbf..6975e98a1 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_gahzranka.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_gahzranka.cpp @@ -41,7 +41,7 @@ struct boss_gahzranka : public BossAI void IsSummonedBy(WorldObject* /*summoner*/) override { - me->GetMotionMaster()->MovePath(me->GetEntry() * 10, false); + me->GetMotionMaster()->MoveWaypoint(me->GetEntry() * 10, false); } void JustEngagedWith(Unit* /*who*/) override diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_jeklik.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_jeklik.cpp index c750fd59c..0b4bddc3d 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_jeklik.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_jeklik.cpp @@ -140,7 +140,7 @@ struct boss_jeklik : public BossAI me->SetDisableGravity(true); DoCastSelf(SPELL_BAT_FORM, true); - me->GetMotionMaster()->MovePath(PATH_JEKLIK_INTRO, false); + me->GetMotionMaster()->MoveWaypoint(PATH_JEKLIK_INTRO, false); } void PathEndReached(uint32 pathId) override @@ -295,7 +295,7 @@ struct npc_batrider : public CreatureAI me->SetSpeed(MOVE_WALK, 5.0f, true); me->SetCanFly(true); - me->GetMotionMaster()->MoveSplinePath(PATH_BATRIDER_LOOP); + me->GetMotionMaster()->MovePath(PATH_BATRIDER_LOOP); } else { @@ -375,7 +375,7 @@ struct npc_batrider : public CreatureAI if (!me->isMoving()) { me->SetCanFly(true); - me->GetMotionMaster()->MoveSplinePath(PATH_BATRIDER_LOOP); + me->GetMotionMaster()->MovePath(PATH_BATRIDER_LOOP); } } else if (_mode == BATRIDER_MODE_TRASH) diff --git a/src/server/scripts/EasternKingdoms/zone_elwynn_forest.cpp b/src/server/scripts/EasternKingdoms/zone_elwynn_forest.cpp index b92bcb616..ef651b4c6 100644 --- a/src/server/scripts/EasternKingdoms/zone_elwynn_forest.cpp +++ b/src/server/scripts/EasternKingdoms/zone_elwynn_forest.cpp @@ -182,13 +182,13 @@ struct npc_cameron : public ScriptedAI switch (eventId) { case EVENT_WP_START_GOLDSHIRE: - me->GetMotionMaster()->MovePath(GOLDSHIRE_PATH, false); + me->GetMotionMaster()->MoveWaypoint(GOLDSHIRE_PATH, false); break; case EVENT_WP_START_WOODS: - me->GetMotionMaster()->MovePath(WOODS_PATH, false); + me->GetMotionMaster()->MoveWaypoint(WOODS_PATH, false); break; case EVENT_WP_START_HOUSE: - me->GetMotionMaster()->MovePath(HOUSE_PATH, false); + me->GetMotionMaster()->MoveWaypoint(HOUSE_PATH, false); break; case EVENT_WP_START_LISA: for (uint32 i = 0; i < _childrenGUIDs.size(); ++i) @@ -197,7 +197,7 @@ struct npc_cameron : public ScriptedAI { if (lisa->GetEntry() == NPC_LISA) { - lisa->GetMotionMaster()->MovePath(LISA_PATH, false); + lisa->GetMotionMaster()->MoveWaypoint(LISA_PATH, false); break; } } @@ -233,7 +233,7 @@ struct npc_cameron : public ScriptedAI child->SearchFormation(); // Start movement - me->GetMotionMaster()->MovePath(STORMWIND_PATH, false); + me->GetMotionMaster()->MoveWaypoint(STORMWIND_PATH, false); break; } @@ -386,7 +386,7 @@ struct npc_eastvale_peasent : public ScriptedAI me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_NONE); me->CastSpell(me, SPELL_TRANSFORM_PEASENT_WITH_WOOD); me->SetSpeed(MOVE_WALK, 1.0f); - me->GetMotionMaster()->MovePath(_path, false); + me->GetMotionMaster()->MoveWaypoint(_path, false); } } @@ -418,7 +418,7 @@ struct npc_eastvale_peasent : public ScriptedAI switch (eventId) { case EVENT_MOVETORAELEN: - me->GetMotionMaster()->MovePath(_path + 1, false); + me->GetMotionMaster()->MoveWaypoint(_path + 1, false); break; case EVENT_TALKTORAELEN1: if (Creature* realen = me->FindNearestCreature(NPC_SUPERVISOR_RAELEN, 2.0f, true)) @@ -492,7 +492,7 @@ struct npc_eastvale_peasent : public ScriptedAI case EVENT_PATHBACK: if (Creature* realen = ObjectAccessor::GetCreature(*me, _realenGUID)) realen->AI()->SetData(1, 1); - me->GetMotionMaster()->MovePath(_path + 2, false); + me->GetMotionMaster()->MoveWaypoint(_path + 2, false); break; } } diff --git a/src/server/scripts/EasternKingdoms/zone_eversong_woods.cpp b/src/server/scripts/EasternKingdoms/zone_eversong_woods.cpp index 5c50dc91e..cc3f0104b 100644 --- a/src/server/scripts/EasternKingdoms/zone_eversong_woods.cpp +++ b/src/server/scripts/EasternKingdoms/zone_eversong_woods.cpp @@ -60,7 +60,7 @@ struct npc_partygoer_pather : public ScriptedAI switch (eventId) { case EVENT_PATH: - me->GetMotionMaster()->MovePath(_path, false); + me->GetMotionMaster()->MoveWaypoint(_path, false); break; case EVENT_RANDOM_ACTION_PATHER: { diff --git a/src/server/scripts/EasternKingdoms/zone_isle_of_queldanas.cpp b/src/server/scripts/EasternKingdoms/zone_isle_of_queldanas.cpp index c3d7edd07..15192af96 100644 --- a/src/server/scripts/EasternKingdoms/zone_isle_of_queldanas.cpp +++ b/src/server/scripts/EasternKingdoms/zone_isle_of_queldanas.cpp @@ -539,16 +539,16 @@ public: break; case 3: me->SetWalk(true); - me->GetMotionMaster()->MovePath(me->GetEntry() * 100, false); + me->GetMotionMaster()->MoveWaypoint(me->GetEntry() * 100, false); if (Creature* c = me->FindNearestCreature(NPC_THERON, 60.0f, true)) { c->SetWalk(true); - c->GetMotionMaster()->MovePath(c->GetEntry() * 100, false); + c->GetMotionMaster()->MoveWaypoint(c->GetEntry() * 100, false); } if (Creature* c = me->FindNearestCreature(NPC_AURIC, 60.0f, true)) { c->SetWalk(true); - c->GetMotionMaster()->MovePath(c->GetEntry() * 100, false); + c->GetMotionMaster()->MoveWaypoint(c->GetEntry() * 100, false); } break; case 4: diff --git a/src/server/scripts/EasternKingdoms/zone_undercity.cpp b/src/server/scripts/EasternKingdoms/zone_undercity.cpp index 9ff724ee5..a7218f9b1 100644 --- a/src/server/scripts/EasternKingdoms/zone_undercity.cpp +++ b/src/server/scripts/EasternKingdoms/zone_undercity.cpp @@ -1321,22 +1321,22 @@ public: if (Unit* temp = me->SummonCreature(NPC_SW_SOLDIER, AllianceSpawn[8].x, AllianceSpawn[8].y, AllianceSpawn[8].z, 0, TEMPSUMMON_TIMED_DESPAWN, 90000)) { allianceGuardsGUID.push_back(temp->GetGUID()); - temp->GetMotionMaster()->MovePath(NPC_SW_SOLDIER * 10, false); + temp->GetMotionMaster()->MoveWaypoint(NPC_SW_SOLDIER * 10, false); } if (Unit* temp = me->SummonCreature(NPC_SW_SOLDIER, AllianceSpawn[8].x, AllianceSpawn[8].y, AllianceSpawn[8].z, 0, TEMPSUMMON_TIMED_DESPAWN, 90000)) { allianceGuardsGUID.push_back(temp->GetGUID()); - temp->GetMotionMaster()->MovePath((NPC_SW_SOLDIER * 10) + 1, false); + temp->GetMotionMaster()->MoveWaypoint((NPC_SW_SOLDIER * 10) + 1, false); } if (Unit* temp = me->SummonCreature(NPC_SW_SOLDIER, AllianceSpawn[8].x, AllianceSpawn[8].y, AllianceSpawn[8].z, 0, TEMPSUMMON_TIMED_DESPAWN, 90000)) { allianceGuardsGUID.push_back(temp->GetGUID()); - temp->GetMotionMaster()->MovePath((NPC_SW_SOLDIER * 10) + 2, false); + temp->GetMotionMaster()->MoveWaypoint((NPC_SW_SOLDIER * 10) + 2, false); } if (Unit* temp = me->SummonCreature(NPC_SW_SOLDIER, AllianceSpawn[8].x, AllianceSpawn[8].y, AllianceSpawn[8].z, 0, TEMPSUMMON_TIMED_DESPAWN, 90000)) { allianceGuardsGUID.push_back(temp->GetGUID()); - temp->GetMotionMaster()->MovePath((NPC_SW_SOLDIER * 10) + 3, false); + temp->GetMotionMaster()->MoveWaypoint((NPC_SW_SOLDIER * 10) + 3, false); } break; case 8: @@ -1348,7 +1348,7 @@ public: case 10: if (Unit* temp = me->SummonCreature(NPC_DREADLORD, AllianceSpawn[11].x, AllianceSpawn[11].y, AllianceSpawn[11].z, TEMPSUMMON_DEAD_DESPAWN)) { - temp->GetMotionMaster()->MovePath(NPC_DREADLORD * 10, false); + temp->GetMotionMaster()->MoveWaypoint(NPC_DREADLORD * 10, false); temp->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_KNOCK_BACK, true); temp->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_KNOCK_BACK_DEST, true); } @@ -1536,7 +1536,7 @@ public: case 8: if (Creature* jaina = ObjectAccessor::GetCreature(*me, jainaGUID)) { - jaina->GetMotionMaster()->MovePath(NPC_JAINA * 10, false); + jaina->GetMotionMaster()->MoveWaypoint(NPC_JAINA * 10, false); jaina->setActive(true); } bStepping = false; @@ -2537,9 +2537,9 @@ public: { case 0: // Vortex if (Creature* whirlwind1 = me->SummonCreature(NPC_VORTEX, ThrallSpawn[0].x, ThrallSpawn[0].y, ThrallSpawn[0].z, ThrallSpawn[0].o, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 30 * IN_MILLISECONDS)) - whirlwind1->GetMotionMaster()->MovePath(NPC_WHIRLWIND * 10, false); + whirlwind1->GetMotionMaster()->MoveWaypoint(NPC_WHIRLWIND * 10, false); if (Creature* whirlwind2 = me->SummonCreature(NPC_VORTEX, ThrallSpawn[0].x, ThrallSpawn[0].y, ThrallSpawn[0].z, ThrallSpawn[0].o, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 30 * IN_MILLISECONDS)) - whirlwind2->GetMotionMaster()->MovePath(NPC_WHIRLWIND * 100, false); + whirlwind2->GetMotionMaster()->MoveWaypoint(NPC_WHIRLWIND * 100, false); break; case 1: // BATTLING_COURTYARD Initial Spawn @@ -2762,7 +2762,7 @@ public: { hordeGuardsGUID.push_back(temp->GetGUID()); temp->AI()->Talk(SAY_FOR_THE_HORDE); - temp->GetMotionMaster()->MovePath(NPC_WARSONG_BATTLEGUARD * 100, false); + temp->GetMotionMaster()->MoveWaypoint(NPC_WARSONG_BATTLEGUARD * 100, false); } break; // Valimathras Room Preparation @@ -2975,7 +2975,7 @@ public: me->SetWalk(false); if (Creature* sylvanas = ObjectAccessor::GetCreature(*me, sylvanasfollowGUID)) { - sylvanas->GetMotionMaster()->MovePath(NPC_SYLVANAS * 100, false); + sylvanas->GetMotionMaster()->MoveWaypoint(NPC_SYLVANAS * 100, false); sylvanas->setActive(true); } break; @@ -3007,7 +3007,7 @@ public: SetEscortPaused(false); me->SetWalk(true); if (Creature* sylvanas = ObjectAccessor::GetCreature(*me, sylvanasfollowGUID)) - sylvanas->GetMotionMaster()->MovePath(NPC_SYLVANAS * 1000, false); + sylvanas->GetMotionMaster()->MoveWaypoint(NPC_SYLVANAS * 1000, false); JumpToNextStep(3 * IN_MILLISECONDS); break; } diff --git a/src/server/scripts/Events/hallows_end.cpp b/src/server/scripts/Events/hallows_end.cpp index 5bda46f13..273e5d38f 100644 --- a/src/server/scripts/Events/hallows_end.cpp +++ b/src/server/scripts/Events/hallows_end.cpp @@ -428,7 +428,7 @@ struct npc_costumed_orphan_matron : public ScriptedAI GetInitXYZ(x, y, z, o, path); if (Creature* cr = me->SummonCreature(NPC_SHADE_OF_HORSEMAN, x, y, z, o, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000)) { - cr->GetMotionMaster()->MovePath(path, true); + cr->GetMotionMaster()->MoveWaypoint(path, true); cr->AI()->DoAction(path); horseGUID = cr->GetGUID(); } @@ -1191,7 +1191,7 @@ struct boss_headless_horseman : public ScriptedAI break; case 3: me->SetDisableGravity(true); - me->GetMotionMaster()->MovePath(236820, false); + me->GetMotionMaster()->MoveWaypoint(236820, false); me->CastSpell(me, SPELL_SHAKE_CAMERA_SMALL, true); player->Say(TALK_PLAYER_FELT_DEATH); Talk(TALK_ENTRANCE); diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_anetheron.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_anetheron.cpp index 69eaa77ea..02a718379 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_anetheron.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_anetheron.cpp @@ -97,7 +97,7 @@ public: Talk(SAY_ONSPAWN, 1200ms); if (action == DATA_ANETHERON) - me->GetMotionMaster()->MovePath(urand(ALLIANCE_BASE_CHARGE_1, ALLIANCE_BASE_CHARGE_3), false); + me->GetMotionMaster()->MoveWaypoint(urand(ALLIANCE_BASE_CHARGE_1, ALLIANCE_BASE_CHARGE_3), false); } void PathEndReached(uint32 pathId) override @@ -109,7 +109,7 @@ public: case ALLIANCE_BASE_CHARGE_3: me->m_Events.AddEventAtOffset([this]() { - me->GetMotionMaster()->MovePath(urand(ALLIANCE_BASE_PATROL_1, ALLIANCE_BASE_PATROL_3), true); + me->GetMotionMaster()->MoveWaypoint(urand(ALLIANCE_BASE_PATROL_1, ALLIANCE_BASE_PATROL_3), true); }, 1s); break; } diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_azgalor.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_azgalor.cpp index 4d0c1c3c9..fa931454f 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_azgalor.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_azgalor.cpp @@ -86,7 +86,7 @@ public: Talk(SAY_ONSPAWN, 1200ms); if (action == DATA_AZGALOR) - me->GetMotionMaster()->MovePath(HORDE_BOSS_PATH, false); + me->GetMotionMaster()->MoveWaypoint(HORDE_BOSS_PATH, false); } void KilledUnit(Unit * victim) override diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_kazrogal.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_kazrogal.cpp index a4855f855..991b8214f 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_kazrogal.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_kazrogal.cpp @@ -106,7 +106,7 @@ public: Talk(SAY_ONSPAWN, 1200ms); if (action == DATA_KAZROGAL) - me->GetMotionMaster()->MovePath(HORDE_BOSS_PATH, false); + me->GetMotionMaster()->MoveWaypoint(HORDE_BOSS_PATH, false); } void KilledUnit(Unit * victim) override diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_rage_winterchill.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_rage_winterchill.cpp index 39bce4e6e..887a34570 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_rage_winterchill.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_rage_winterchill.cpp @@ -101,7 +101,7 @@ public: Talk(SAY_ONSPAWN, 1200ms); if (action == DATA_WINTERCHILL) - me->GetMotionMaster()->MovePath(urand(ALLIANCE_BASE_CHARGE_1, ALLIANCE_BASE_CHARGE_3), false); + me->GetMotionMaster()->MoveWaypoint(urand(ALLIANCE_BASE_CHARGE_1, ALLIANCE_BASE_CHARGE_3), false); } void PathEndReached(uint32 pathId) override @@ -113,7 +113,7 @@ public: case ALLIANCE_BASE_CHARGE_3: me->m_Events.AddEventAtOffset([this]() { - me->GetMotionMaster()->MovePath(urand(ALLIANCE_BASE_PATROL_1, ALLIANCE_BASE_PATROL_3), true); + me->GetMotionMaster()->MoveWaypoint(urand(ALLIANCE_BASE_PATROL_1, ALLIANCE_BASE_PATROL_3), true); }, 1s); break; } diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal.cpp index 01b12a9ef..1ec84feb5 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal.cpp @@ -188,7 +188,7 @@ public: else { creature->AI()->Talk(SAY_SUCCESS); - creature->GetMotionMaster()->MovePath(JAINA_RETREAT_PATH, false); + creature->GetMotionMaster()->MoveWaypoint(JAINA_RETREAT_PATH, false); } } return true; @@ -493,15 +493,15 @@ struct npc_hyjal_ground_trash : public ScriptedAI case DATA_WINTERCHILL: case DATA_ANETHERON: case DATA_ALLIANCE_RETREAT: - me->GetMotionMaster()->MovePath(urand(ALLIANCE_BASE_CHARGE_1, ALLIANCE_BASE_CHARGE_3), false); + me->GetMotionMaster()->MoveWaypoint(urand(ALLIANCE_BASE_CHARGE_1, ALLIANCE_BASE_CHARGE_3), false); break; case DATA_KAZROGAL: case DATA_AZGALOR: case DATA_HORDE_RETREAT: - me->GetMotionMaster()->MovePath(urand(HORDE_BASE_CHARGE_1, HORDE_BASE_CHARGE_3), false); + me->GetMotionMaster()->MoveWaypoint(urand(HORDE_BASE_CHARGE_1, HORDE_BASE_CHARGE_3), false); break; case DATA_ARCHIMONDE: - me->GetMotionMaster()->MovePath(urand(NIGHT_ELF_BASE_CHARGE_1, NIGHT_ELF_BASE_CHARGE_3), false); + me->GetMotionMaster()->MoveWaypoint(urand(NIGHT_ELF_BASE_CHARGE_1, NIGHT_ELF_BASE_CHARGE_3), false); break; } } @@ -517,7 +517,7 @@ struct npc_hyjal_ground_trash : public ScriptedAI case ALLIANCE_BASE_CHARGE_3: me->m_Events.AddEventAtOffset([this]() { - me->GetMotionMaster()->MovePath(urand(ALLIANCE_BASE_PATROL_1, ALLIANCE_BASE_PATROL_3), true); + me->GetMotionMaster()->MoveWaypoint(urand(ALLIANCE_BASE_PATROL_1, ALLIANCE_BASE_PATROL_3), true); }, 1s); break; case HORDE_BASE_CHARGE_1: @@ -525,7 +525,7 @@ struct npc_hyjal_ground_trash : public ScriptedAI case HORDE_BASE_CHARGE_3: me->m_Events.AddEventAtOffset([this]() { - me->GetMotionMaster()->MovePath(urand(HORDE_BASE_PATROL_1, HORDE_BASE_PATROL_3), true); + me->GetMotionMaster()->MoveWaypoint(urand(HORDE_BASE_PATROL_1, HORDE_BASE_PATROL_3), true); }, 1s); break; case NIGHT_ELF_BASE_CHARGE_1: @@ -616,9 +616,9 @@ struct npc_hyjal_gargoyle : public ScriptedAI case DATA_AZGALOR: case DATA_HORDE_RETREAT: if (me->GetPositionX() < 5500.f) - me->GetMotionMaster()->MovePath(urand(GARGOYLE_PATH_FORTRESS_1, GARGOYLE_PATH_FORTRESS_3), false); + me->GetMotionMaster()->MoveWaypoint(urand(GARGOYLE_PATH_FORTRESS_1, GARGOYLE_PATH_FORTRESS_3), false); else - me->GetMotionMaster()->MovePath(urand(GARGOYLE_PATH_TROLL_CAMP_1, GARGOYLE_PATH_TROLL_CAMP_3), false); + me->GetMotionMaster()->MoveWaypoint(urand(GARGOYLE_PATH_TROLL_CAMP_1, GARGOYLE_PATH_TROLL_CAMP_3), false); break; default: break; @@ -687,9 +687,9 @@ struct npc_hyjal_frost_wyrm : public ScriptedAI case DATA_AZGALOR: case DATA_HORDE_RETREAT: if (me->GetPositionX() < 5500.f) - me->GetMotionMaster()->MovePath(FROST_WYRM_FORTRESS, false); + me->GetMotionMaster()->MoveWaypoint(FROST_WYRM_FORTRESS, false); else - me->GetMotionMaster()->MovePath(FROST_WYRM_TROLL_CAMP, false); + me->GetMotionMaster()->MoveWaypoint(FROST_WYRM_TROLL_CAMP, false); break; default: break; @@ -702,7 +702,7 @@ struct npc_hyjal_frost_wyrm : public ScriptedAI { me->m_Events.AddEventAtOffset([this]() { - me->GetMotionMaster()->MovePath(FROST_WYRM_FORTRESS_PATROL, true); + me->GetMotionMaster()->MoveWaypoint(FROST_WYRM_FORTRESS_PATROL, true); }, 1s); } } diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_lieutenant_drake.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_lieutenant_drake.cpp index 16ad3de36..fb4185d8f 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_lieutenant_drake.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_lieutenant_drake.cpp @@ -48,7 +48,7 @@ struct boss_lieutenant_drake : public BossAI { runSecondPath = false; pathId = me->GetEntry() * 10; - me->GetMotionMaster()->MovePath(pathId, false); + me->GetMotionMaster()->MoveWaypoint(pathId, false); } void JustEngagedWith(Unit* /*who*/) override @@ -132,7 +132,7 @@ struct boss_lieutenant_drake : public BossAI if (runSecondPath) { runSecondPath = false; - me->GetMotionMaster()->MovePath(pathId, true); + me->GetMotionMaster()->MoveWaypoint(pathId, true); } if (!UpdateVictim()) diff --git a/src/server/scripts/Kalimdor/RazorfenDowns/razorfen_downs.cpp b/src/server/scripts/Kalimdor/RazorfenDowns/razorfen_downs.cpp index 0bd0febc7..1e64e45bd 100644 --- a/src/server/scripts/Kalimdor/RazorfenDowns/razorfen_downs.cpp +++ b/src/server/scripts/Kalimdor/RazorfenDowns/razorfen_downs.cpp @@ -126,7 +126,7 @@ public: Talk(SAY_QUEST_ACCEPTED); me->RemoveNpcFlag(UNIT_NPC_FLAG_QUESTGIVER); me->SetFaction(FACTION_ESCORTEE_N_NEUTRAL_ACTIVE); - me->GetMotionMaster()->MovePath(PATH_ESCORT, false); + me->GetMotionMaster()->MoveWaypoint(PATH_ESCORT, false); } } diff --git a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ayamiss.cpp b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ayamiss.cpp index d36cf4718..c279f925d 100644 --- a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ayamiss.cpp +++ b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ayamiss.cpp @@ -92,7 +92,7 @@ struct boss_ayamiss : public BossAI me->SetReactState(REACT_PASSIVE); me->SetCanFly(false); me->SetDisableGravity(false); - me->GetMotionMaster()->MovePath(me->GetEntry() * 10, false); + me->GetMotionMaster()->MoveWaypoint(me->GetEntry() * 10, false); DoResetThreatList(); scheduler.CancelGroup(GROUP_AIR); }); @@ -291,7 +291,7 @@ class spell_ayamiss_swarmer_teleport_trigger : public SpellScript uint32 pathId = data.pathId; caster->m_Events.AddEventAtOffset([caster, pathId]() { - caster->GetMotionMaster()->MovePath(pathId, false); + caster->GetMotionMaster()->MoveWaypoint(pathId, false); }, 1s); } @@ -361,7 +361,7 @@ public: void HandleScript(SpellEffIndex /*effIndex*/) { GetCaster()->ToCreature()->GetMotionMaster()->Clear(); - GetCaster()->ToCreature()->GetMotionMaster()->MovePath(_pathId, false); + GetCaster()->ToCreature()->GetMotionMaster()->MoveWaypoint(_pathId, false); } void Register() override diff --git a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ossirian.cpp b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ossirian.cpp index 10141d57c..083b9895f 100644 --- a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ossirian.cpp +++ b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ossirian.cpp @@ -188,7 +188,7 @@ struct boss_ossirian : public BossAI { if (Creature* vortex = me->SummonCreature(NPC_SAND_VORTEX, pos)) { - vortex->GetMotionMaster()->MovePath(pathIds.front(), true); + vortex->GetMotionMaster()->MoveWaypoint(pathIds.front(), true); pathIds.reverse(); } } diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_bug_trio.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_bug_trio.cpp index 2d97ba3da..241a04939 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_bug_trio.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_bug_trio.cpp @@ -204,7 +204,7 @@ public: if (me->GetEntry() == NPC_VEM) { - me->GetMotionMaster()->MovePath(VEM_WAYPOINT_PATH, true); + me->GetMotionMaster()->MoveWaypoint(VEM_WAYPOINT_PATH, true); } } diff --git a/src/server/scripts/Kalimdor/ZulFarrak/instance_zulfarrak.cpp b/src/server/scripts/Kalimdor/ZulFarrak/instance_zulfarrak.cpp index 397e7b611..0ec6a82de 100644 --- a/src/server/scripts/Kalimdor/ZulFarrak/instance_zulfarrak.cpp +++ b/src/server/scripts/Kalimdor/ZulFarrak/instance_zulfarrak.cpp @@ -437,7 +437,7 @@ public: { if (Creature* add = instance->GetCreature(*addsAtBase.begin())) { - add->GetMotionMaster()->MovePath(PATH_ADDS, false); + add->GetMotionMaster()->MoveWaypoint(PATH_ADDS, false); movedadds.push_back(add->GetGUID()); } diff --git a/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_hadronox.cpp b/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_hadronox.cpp index 8f66ac8ce..37e2542a2 100644 --- a/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_hadronox.cpp +++ b/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_hadronox.cpp @@ -121,11 +121,11 @@ public: // Xinef: cannot use pathfinding... if (summon->GetDistance(477.0f, 618.0f, 771.0f) < 5.0f) - summon->GetMotionMaster()->MovePath(3000012, false); + summon->GetMotionMaster()->MoveWaypoint(3000012, false); else if (summon->GetDistance(583.0f, 617.0f, 771.0f) < 5.0f) - summon->GetMotionMaster()->MovePath(3000013, false); + summon->GetMotionMaster()->MoveWaypoint(3000013, false); else if (summon->GetDistance(581.0f, 608.5f, 739.0f) < 5.0f) - summon->GetMotionMaster()->MovePath(3000014, false); + summon->GetMotionMaster()->MoveWaypoint(3000014, false); } void KilledUnit(Unit* victim) override diff --git a/src/server/scripts/Northrend/ChamberOfAspects/ObsidianSanctum/boss_sartharion.cpp b/src/server/scripts/Northrend/ChamberOfAspects/ObsidianSanctum/boss_sartharion.cpp index 51f872bb7..57515bfe2 100644 --- a/src/server/scripts/Northrend/ChamberOfAspects/ObsidianSanctum/boss_sartharion.cpp +++ b/src/server/scripts/Northrend/ChamberOfAspects/ObsidianSanctum/boss_sartharion.cpp @@ -1071,7 +1071,7 @@ public: Talk(SAY_TENEBRON_RESPOND); me->SetCanFly(true); me->SetSpeed(MOVE_FLIGHT, 3.0f); - me->GetMotionMaster()->MovePath(me->GetEntry() * 10, false); + me->GetMotionMaster()->MoveWaypoint(me->GetEntry() * 10, false); } } @@ -1254,7 +1254,7 @@ public: Talk(SAY_SHADRON_RESPOND); me->SetCanFly(true); me->SetSpeed(MOVE_FLIGHT, 3.0f); - me->GetMotionMaster()->MovePath(me->GetEntry() * 10, false); + me->GetMotionMaster()->MoveWaypoint(me->GetEntry() * 10, false); } } @@ -1370,7 +1370,7 @@ public: Talk(SAY_SHADRON_RESPOND); me->SetCanFly(true); me->SetSpeed(MOVE_FLIGHT, 3.0f); - me->GetMotionMaster()->MovePath(me->GetEntry() * 10, false); + me->GetMotionMaster()->MoveWaypoint(me->GetEntry() * 10, false); } } diff --git a/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/instance_forge_of_souls.cpp b/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/instance_forge_of_souls.cpp index a3e7c184a..c2eb0864b 100644 --- a/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/instance_forge_of_souls.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/instance_forge_of_souls.cpp @@ -140,7 +140,7 @@ public: { for (int8 i = 0; outroPositions[i].entry[GetTeamIdInInstance()] != 0; ++i) if (Creature* summon = instance->SummonCreature(outroPositions[i].entry[GetTeamIdInInstance()], outroPositions[i].startPosition)) - summon->GetMotionMaster()->MovePath(outroPositions[i].pathId, false); + summon->GetMotionMaster()->MoveWaypoint(outroPositions[i].pathId, false); } } diff --git a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_krickandick.cpp b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_krickandick.cpp index f18fecfa2..6bf24b4ab 100644 --- a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_krickandick.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_krickandick.cpp @@ -369,7 +369,7 @@ public: if (pInstance) { if (Creature* c = pInstance->instance->GetCreature(pInstance->GetGuidData(DATA_TYRANNUS_EVENT_GUID))) - c->GetMotionMaster()->MovePath(PATH_BEGIN_VALUE + 10, false); + c->GetMotionMaster()->MoveWaypoint(PATH_BEGIN_VALUE + 10, false); if (Creature* c = pInstance->instance->GetCreature(pInstance->GetGuidData(DATA_LEADER_FIRST_GUID))) c->AI()->Talk(c->GetEntry() == NPC_JAINA_PART1 ? SAY_JAINA_KRICK_2 : SAY_SYLVANAS_KRICK_2); } @@ -440,7 +440,7 @@ public: if (Creature* c = pInstance->instance->GetCreature(pInstance->GetGuidData(DATA_LEADER_FIRST_GUID))) { c->AI()->Talk(c->GetEntry() == NPC_JAINA_PART1 ? SAY_JAINA_KRICK_3 : SAY_SYLVANAS_KRICK_3); - c->GetMotionMaster()->MovePath(PATH_BEGIN_VALUE + 11, false); + c->GetMotionMaster()->MoveWaypoint(PATH_BEGIN_VALUE + 11, false); } } me->setActive(false); diff --git a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_scourgelord_tyrannus.cpp b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_scourgelord_tyrannus.cpp index 4ff7de00c..007e52c57 100644 --- a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_scourgelord_tyrannus.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_scourgelord_tyrannus.cpp @@ -108,7 +108,7 @@ public: { c->RemoveAura(46598); c->GetMotionMaster()->Clear(); - c->GetMotionMaster()->MovePath(PATH_BEGIN_VALUE + 18, true); + c->GetMotionMaster()->MoveWaypoint(PATH_BEGIN_VALUE + 18, true); } me->SetHomePosition(exitPos); me->GetMotionMaster()->MoveJump(exitPos, 10.0f, 2.0f); diff --git a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/pit_of_saron.cpp b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/pit_of_saron.cpp index b3174fb37..5cc7c00a2 100644 --- a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/pit_of_saron.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/pit_of_saron.cpp @@ -551,7 +551,7 @@ public: while (FBSData[i].entry) { if (Creature* c = me->SummonCreature(FBSData[i].entry, 688.69f + i * 1.8f, FBSSpawnPos.GetPositionY() + (float)irand(-2, 2), FBSSpawnPos.GetPositionZ(), 3 * M_PI / 2)) - c->GetMotionMaster()->MovePath(FBSData[i].pathId, false); + c->GetMotionMaster()->MoveWaypoint(FBSData[i].pathId, false); ++i; } events.RescheduleEvent(2, 3s); @@ -1284,7 +1284,7 @@ public: events.RescheduleEvent(8, 2s); break; case 8: - me->GetMotionMaster()->MovePath(me->GetEntry() == NPC_JAINA_PART2 ? PATH_BEGIN_VALUE + 16 : PATH_BEGIN_VALUE + 17, false); + me->GetMotionMaster()->MoveWaypoint(me->GetEntry() == NPC_JAINA_PART2 ? PATH_BEGIN_VALUE + 16 : PATH_BEGIN_VALUE + 17, false); break; case 10: if (Creature* x = pInstance->instance->GetCreature(pInstance->GetGuidData(DATA_MARTIN_OR_GORKUN_GUID))) diff --git a/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp b/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp index 4c08dabec..e4f745aae 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp @@ -533,7 +533,7 @@ public: case EVENT_SAURFANG_RUN: if (Creature* factionNPC = ObjectAccessor::GetCreature(*me, _factionNPC)) { - factionNPC->GetMotionMaster()->MovePath(factionNPC->GetSpawnId() * 10, false); + factionNPC->GetMotionMaster()->MoveWaypoint(factionNPC->GetSpawnId() * 10, false); factionNPC->DespawnOrUnsummon(46500ms); std::list followers; factionNPC->GetCreaturesWithEntryInRange(followers, 30, _instance->GetData(DATA_TEAMID_IN_INSTANCE) == TEAM_HORDE ? NPC_KOR_KRON_GENERAL : NPC_ALLIANCE_COMMANDER); diff --git a/src/server/scripts/Northrend/IcecrownCitadel/instance_icecrown_citadel.cpp b/src/server/scripts/Northrend/IcecrownCitadel/instance_icecrown_citadel.cpp index 8298f5a75..7929a51ab 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/instance_icecrown_citadel.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/instance_icecrown_citadel.cpp @@ -1742,7 +1742,7 @@ public: { sindragosa->setActive(true); sindragosa->SetDisableGravity(true); - sindragosa->GetMotionMaster()->MovePath(NPC_SINDRAGOSA * 10, true); + sindragosa->GetMotionMaster()->MoveWaypoint(NPC_SINDRAGOSA * 10, true); if (TempSummon* summon = sindragosa->ToTempSummon()) { diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp index 18ef70ed8..46f8e0bc4 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp @@ -1416,7 +1416,7 @@ public: _startTimer -= diff; if (_startTimer <= 0) { - me->GetMotionMaster()->MovePath(3000000 + urand(0, 11), true); + me->GetMotionMaster()->MoveWaypoint(3000000 + urand(0, 11), true); _startTimer = 0; } } diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_razorscale.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_razorscale.cpp index 1b3377350..7d1ad5251 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_razorscale.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_razorscale.cpp @@ -354,17 +354,7 @@ public: { me->StopMoving(); startPath = false; - if (WaypointPath const* i_path = sWaypointMgr->GetPath(me->GetWaypointPath())) - { - Movement::PointsArray pathPoints; - pathPoints.push_back(G3D::Vector3(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ())); - for (uint8 i = 0; i < i_path->size(); ++i) - { - WaypointData const* node = i_path->at(i); - pathPoints.push_back(G3D::Vector3(node->x, node->y, node->z)); - } - me->GetMotionMaster()->MoveSplinePath(&pathPoints); - } + me->GetMotionMaster()->MovePath(me->GetWaypointPath(), FORCED_MOVEMENT_NONE, PathSource::WAYPOINT_MGR); } if (!UpdateVictim()) diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/utgarde_keep.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/utgarde_keep.cpp index 825efd969..c3e694d10 100644 --- a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/utgarde_keep.cpp +++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/utgarde_keep.cpp @@ -139,7 +139,7 @@ struct npc_enslaved_proto_drake : public ScriptedAI _setData = true; me->SetCanFly(true); me->SetDisableGravity(true); - me->GetMotionMaster()->MovePath(PATH_PROTODRAKE, false); + me->GetMotionMaster()->MoveWaypoint(PATH_PROTODRAKE, false); } } diff --git a/src/server/scripts/Northrend/zone_borean_tundra.cpp b/src/server/scripts/Northrend/zone_borean_tundra.cpp index 3546a3c7a..805c4afab 100644 --- a/src/server/scripts/Northrend/zone_borean_tundra.cpp +++ b/src/server/scripts/Northrend/zone_borean_tundra.cpp @@ -1688,7 +1688,7 @@ public: // Arthas load path if (Creature* arthas = ObjectAccessor::GetCreature(*me, _arthasGUID)) { - arthas->GetMotionMaster()->MovePath(PATH_ARTHAS, false); + arthas->GetMotionMaster()->MoveWaypoint(PATH_ARTHAS, false); } _events.ScheduleEvent(EVENT_THASSARIAN_SCRIPT_3, 1s); break; @@ -1696,7 +1696,7 @@ public: // Talbot load path if (Creature* talbot = ObjectAccessor::GetCreature(*me, _talbotGUID)) { - talbot->GetMotionMaster()->MovePath(PATH_TALBOT, false); + talbot->GetMotionMaster()->MoveWaypoint(PATH_TALBOT, false); } _events.ScheduleEvent(EVENT_THASSARIAN_SCRIPT_4, 20s); break; @@ -1730,7 +1730,7 @@ public: arlos->SetWalk(true); arlos->SetImmuneToAll(true); arlos->RemoveNpcFlag(UNIT_NPC_FLAG_QUESTGIVER); - arlos->GetMotionMaster()->MovePath(PATH_ARLOS, false); + arlos->GetMotionMaster()->MoveWaypoint(PATH_ARLOS, false); } if (Creature* leryssa = me->SummonCreature(NPC_LERYSSA, 3751.0986f, 3614.9219f, 473.4048f, 4.5029f, TEMPSUMMON_CORPSE_TIMED_DESPAWN)) { @@ -1738,7 +1738,7 @@ public: leryssa->SetWalk(true); leryssa->SetImmuneToAll(true); leryssa->RemoveNpcFlag(UNIT_NPC_FLAG_GOSSIP | UNIT_NPC_FLAG_QUESTGIVER); - leryssa->GetMotionMaster()->MovePath(PATH_LERYSSA, false); + leryssa->GetMotionMaster()->MoveWaypoint(PATH_LERYSSA, false); } _events.ScheduleEvent(EVENT_THASSARIAN_SCRIPT_7, 7s); break; @@ -1993,7 +1993,7 @@ public: _playerGUID = player->GetGUID(); CloseGossipMenuFor(player); me->RemoveNpcFlag(UNIT_NPC_FLAG_GOSSIP); - me->GetMotionMaster()->MovePath(PATH_THASSARIAN, false); + me->GetMotionMaster()->MoveWaypoint(PATH_THASSARIAN, false); } } diff --git a/src/server/scripts/Northrend/zone_crystalsong_forest.cpp b/src/server/scripts/Northrend/zone_crystalsong_forest.cpp index ac3aa4ef2..c1829ccbd 100644 --- a/src/server/scripts/Northrend/zone_crystalsong_forest.cpp +++ b/src/server/scripts/Northrend/zone_crystalsong_forest.cpp @@ -41,25 +41,7 @@ struct npc_preparations_for_war_vehicle : public NullCreatureAI void InitializeAI() override { - WPPath* path = sSmartWaypointMgr->GetPath(me->GetEntry()); - if (!path || path->empty()) - { - me->DespawnOrUnsummon(1ms); - return; - } - - Movement::PointsArray pathPoints; - pathPoints.push_back(G3D::Vector3(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ())); - - uint32 wpCounter = 1; - WPPath::const_iterator itr; - while ((itr = path->find(wpCounter++)) != path->end()) - { - WayPoint* wp = itr->second; - pathPoints.push_back(G3D::Vector3(wp->x, wp->y, wp->z)); - } - - me->GetMotionMaster()->MoveSplinePath(&pathPoints); + me->GetMotionMaster()->MovePath(me->GetEntry(), FORCED_MOVEMENT_NONE, PathSource::SMART_WAYPOINT_MGR); NullCreatureAI::InitializeAI(); pointId = 0; diff --git a/src/server/scripts/Northrend/zone_dragonblight.cpp b/src/server/scripts/Northrend/zone_dragonblight.cpp index 5710efa29..b4aa561b9 100644 --- a/src/server/scripts/Northrend/zone_dragonblight.cpp +++ b/src/server/scripts/Northrend/zone_dragonblight.cpp @@ -614,7 +614,7 @@ public: uint32 path = me->GetEntry() * 10 + urand(0, 4); if (me->GetPositionY() > -1150.0f) path += 5; - me->GetMotionMaster()->MovePath(path, false); + me->GetMotionMaster()->MoveWaypoint(path, false); } void MovementInform(uint32 type, uint32 point) override diff --git a/src/server/scripts/Northrend/zone_grizzly_hills.cpp b/src/server/scripts/Northrend/zone_grizzly_hills.cpp index 50c4518be..81ae014d5 100644 --- a/src/server/scripts/Northrend/zone_grizzly_hills.cpp +++ b/src/server/scripts/Northrend/zone_grizzly_hills.cpp @@ -589,77 +589,77 @@ public: case EVENT_WOUNDED_MOVE: if (me->GetPositionY() == -2835.11f) { - me->GetMotionMaster()->MovePath(WOUNDED_MOVE_1, false); + me->GetMotionMaster()->MoveWaypoint(WOUNDED_MOVE_1, false); me->DespawnOrUnsummon(20s); } if (me->GetPositionY() == -2981.89f) { - me->GetMotionMaster()->MovePath(WOUNDED_MOVE_3, false); + me->GetMotionMaster()->MoveWaypoint(WOUNDED_MOVE_3, false); me->DespawnOrUnsummon(18s); } if (me->GetPositionY() == -2934.44f) { - me->GetMotionMaster()->MovePath(WOUNDED_MOVE_3, false); + me->GetMotionMaster()->MoveWaypoint(WOUNDED_MOVE_3, false); me->DespawnOrUnsummon(9s); } if (me->GetPositionY() == -3020.99f) { - me->GetMotionMaster()->MovePath(WOUNDED_MOVE_1, false); + me->GetMotionMaster()->MoveWaypoint(WOUNDED_MOVE_1, false); me->DespawnOrUnsummon(22s); } if (me->GetPositionY() == -2964.73f) { - me->GetMotionMaster()->MovePath(WOUNDED_MOVE_2, false); + me->GetMotionMaster()->MoveWaypoint(WOUNDED_MOVE_2, false); me->DespawnOrUnsummon(15s); } if (me->GetPositionY() == -2940.50f) { - me->GetMotionMaster()->MovePath(WOUNDED_MOVE_1, false); + me->GetMotionMaster()->MoveWaypoint(WOUNDED_MOVE_1, false); me->DespawnOrUnsummon(20s); } if (me->GetPositionY() == -2847.93f) { - me->GetMotionMaster()->MovePath(WOUNDED_MOVE_1, false); + me->GetMotionMaster()->MoveWaypoint(WOUNDED_MOVE_1, false); me->DespawnOrUnsummon(30s); } if (me->GetPositionY() == -2835.31f) { - me->GetMotionMaster()->MovePath(WOUNDED_MOVE_1, false); + me->GetMotionMaster()->MoveWaypoint(WOUNDED_MOVE_1, false); me->DespawnOrUnsummon(27s); } if (me->GetPositionY() == -2822.20f) { - me->GetMotionMaster()->MovePath(WOUNDED_MOVE_1, false); + me->GetMotionMaster()->MoveWaypoint(WOUNDED_MOVE_1, false); me->DespawnOrUnsummon(25s); } if (me->GetPositionY() == -2846.31f) { - me->GetMotionMaster()->MovePath(WOUNDED_MOVE_1, false); + me->GetMotionMaster()->MoveWaypoint(WOUNDED_MOVE_1, false); me->DespawnOrUnsummon(21s); } if (me->GetPositionY() == -2897.23f) { - me->GetMotionMaster()->MovePath(WOUNDED_MOVE_3, false); + me->GetMotionMaster()->MoveWaypoint(WOUNDED_MOVE_3, false); me->DespawnOrUnsummon(15s); } if (me->GetPositionY() == -2886.01f) { - me->GetMotionMaster()->MovePath(WOUNDED_MOVE_3, false); + me->GetMotionMaster()->MoveWaypoint(WOUNDED_MOVE_3, false); me->DespawnOrUnsummon(25s); } if (me->GetPositionY() == -2906.89f) { - me->GetMotionMaster()->MovePath(WOUNDED_MOVE_3, false); + me->GetMotionMaster()->MoveWaypoint(WOUNDED_MOVE_3, false); me->DespawnOrUnsummon(25s); } if (me->GetPositionY() == -3048.94f) { - me->GetMotionMaster()->MovePath(WOUNDED_MOVE_2, false); + me->GetMotionMaster()->MoveWaypoint(WOUNDED_MOVE_2, false); me->DespawnOrUnsummon(30s); } if (me->GetPositionY() == -2961.08f) { - me->GetMotionMaster()->MovePath(WOUNDED_MOVE_2, false); + me->GetMotionMaster()->MoveWaypoint(WOUNDED_MOVE_2, false); me->DespawnOrUnsummon(25s); } break; diff --git a/src/server/scripts/Northrend/zone_icecrown.cpp b/src/server/scripts/Northrend/zone_icecrown.cpp index be6e2f32c..17e0e9589 100644 --- a/src/server/scripts/Northrend/zone_icecrown.cpp +++ b/src/server/scripts/Northrend/zone_icecrown.cpp @@ -1312,25 +1312,7 @@ public: break; case EVENT_START_FLIGHT: { - WPPath* path = sSmartWaypointMgr->GetPath(me->GetEntry()); - if (!path || path->empty()) - { - me->DespawnOrUnsummon(1ms); - return; - } - - Movement::PointsArray pathPoints; - pathPoints.push_back(G3D::Vector3(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ())); - - uint32 wpCounter = 1; - WPPath::const_iterator itr; - while ((itr = path->find(wpCounter++)) != path->end()) - { - WayPoint* wp = itr->second; - pathPoints.push_back(G3D::Vector3(wp->x, wp->y, wp->z)); - } - - me->GetMotionMaster()->MoveSplinePath(&pathPoints); + me->GetMotionMaster()->MovePath(me->GetEntry(), FORCED_MOVEMENT_NONE, PathSource::SMART_WAYPOINT_MGR); events.ScheduleEvent(EVENT_CHECK_PATH_REGEN_HEALTH_BURN_DAMAGE, 1min); events.ScheduleEvent(EVENT_SYNCHRONIZE_SHIELDS, 5s); break; diff --git a/src/server/scripts/Northrend/zone_sholazar_basin.cpp b/src/server/scripts/Northrend/zone_sholazar_basin.cpp index f60a3b5f4..329ab98c0 100644 --- a/src/server/scripts/Northrend/zone_sholazar_basin.cpp +++ b/src/server/scripts/Northrend/zone_sholazar_basin.cpp @@ -1148,17 +1148,7 @@ public: { if (apply && passenger->IsPlayer()) { - Movement::PointsArray pathPoints; - pathPoints.push_back(G3D::Vector3(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ())); - - WaypointPath const* i_path = sWaypointMgr->GetPath(NPC_PLANE); - for (uint8 i = 0; i < i_path->size(); ++i) - { - WaypointData const* node = i_path->at(i); - pathPoints.push_back(G3D::Vector3(node->x, node->y, node->z)); - } - - me->GetMotionMaster()->MoveSplinePath(&pathPoints); + me->GetMotionMaster()->MovePath(NPC_PLANE, FORCED_MOVEMENT_NONE, PathSource::WAYPOINT_MGR); } } diff --git a/src/server/scripts/Northrend/zone_storm_peaks.cpp b/src/server/scripts/Northrend/zone_storm_peaks.cpp index 9b5d5ad50..5a50bee8a 100644 --- a/src/server/scripts/Northrend/zone_storm_peaks.cpp +++ b/src/server/scripts/Northrend/zone_storm_peaks.cpp @@ -467,17 +467,7 @@ public: if (startPath) { startPath = false; - Movement::PointsArray pathPoints; - pathPoints.push_back(G3D::Vector3(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ())); - - WaypointPath const* i_path = sWaypointMgr->GetPath(me->GetWaypointPath()); - for (uint8 i = 0; i < i_path->size(); ++i) - { - WaypointData const* node = i_path->at(i); - pathPoints.push_back(G3D::Vector3(node->x, node->y, node->z)); - } - - me->GetMotionMaster()->MoveSplinePath(&pathPoints); + me->GetMotionMaster()->MovePath(me->GetWaypointPath(), FORCED_MOVEMENT_NONE, PathSource::WAYPOINT_MGR); } if (setCharm) { @@ -849,17 +839,7 @@ public: { Talk(TEXT_EMOTE, passenger); - Movement::PointsArray pathPoints; - pathPoints.push_back(G3D::Vector3(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ())); - - WaypointPath const* i_path = sWaypointMgr->GetPath(NPC_DRAKE); - for (uint8 i = 0; i < i_path->size(); ++i) - { - WaypointData const* node = i_path->at(i); - pathPoints.push_back(G3D::Vector3(node->x, node->y, node->z)); - } - - me->GetMotionMaster()->MoveSplinePath(&pathPoints); + me->GetMotionMaster()->MovePath(NPC_DRAKE, FORCED_MOVEMENT_NONE, PathSource::WAYPOINT_MGR); } } else @@ -1087,15 +1067,7 @@ public: { if (apply) { - Movement::PointsArray pathPoints; - pathPoints.push_back(G3D::Vector3(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ())); - WaypointPath const* i_path = sWaypointMgr->GetPath(me->GetEntry() * 100); - for (uint8 i = 0; i < i_path->size(); ++i) - { - WaypointData const* node = i_path->at(i); - pathPoints.push_back(G3D::Vector3(node->x, node->y, node->z)); - } - me->GetMotionMaster()->MoveSplinePath(&pathPoints); + me->GetMotionMaster()->MovePath(me->GetEntry() * 100, FORCED_MOVEMENT_NONE, PathSource::WAYPOINT_MGR); me->SetCanFly(true); me->SetDisableGravity(true); me->SetSpeed(MOVE_RUN, 6.0f); diff --git a/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_ambassador_hellmaw.cpp b/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_ambassador_hellmaw.cpp index a9afd481c..155dc6cb3 100644 --- a/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_ambassador_hellmaw.cpp +++ b/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_ambassador_hellmaw.cpp @@ -66,7 +66,7 @@ struct boss_ambassador_hellmaw : public BossAI } else { - me->GetMotionMaster()->MovePath(PATH_ID_START, false); + me->GetMotionMaster()->MoveWaypoint(PATH_ID_START, false); } } @@ -88,7 +88,7 @@ struct boss_ambassador_hellmaw : public BossAI DoPlaySoundToSet(me, SOUND_INTRO); isBanished = false; me->SetImmuneToAll(false); - me->GetMotionMaster()->MovePath(PATH_ID_START, false); + me->GetMotionMaster()->MoveWaypoint(PATH_ID_START, false); } void JustEngagedWith(Unit*) override @@ -142,7 +142,7 @@ struct boss_ambassador_hellmaw : public BossAI { me->m_Events.AddEventAtOffset([this]() { - me->GetMotionMaster()->MovePath(PATH_ID_PATHING, true); + me->GetMotionMaster()->MoveWaypoint(PATH_ID_PATHING, true); }, 20s); } } diff --git a/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp b/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp index c774c1a5e..aefe2451c 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp @@ -794,7 +794,7 @@ struct npc_akama_illidan : public ScriptedAI if (instance->GetBossState(DATA_AKAMA_ILLIDAN) != DONE) { - me->GetMotionMaster()->MovePath(PATH_AKAMA_ILLIDARI_COUNCIL_2, false); + me->GetMotionMaster()->MoveWaypoint(PATH_AKAMA_ILLIDARI_COUNCIL_2, false); } else { @@ -811,7 +811,7 @@ struct npc_akama_illidan : public ScriptedAI { me->NearTeleportTo(AkamaIllidariCouncilTeleport); me->RemoveNpcFlag(UNIT_NPC_FLAG_GOSSIP); - me->GetMotionMaster()->MovePath(PATH_AKAMA_ILLIDARI_COUNCIL_1, false); + me->GetMotionMaster()->MoveWaypoint(PATH_AKAMA_ILLIDARI_COUNCIL_1, false); } break; case ACTION_AKAMA_MINIONS: @@ -974,7 +974,7 @@ struct npc_akama_illidan : public ScriptedAI Talk(SAY_AKAMA_SALUTE); }, 56955ms); // 6275ms me->m_Events.AddEventAtOffset([&] { - me->GetMotionMaster()->MovePath(PATH_AKAMA_ILLIDARI_COUNCIL_3, false); + me->GetMotionMaster()->MoveWaypoint(PATH_AKAMA_ILLIDARI_COUNCIL_3, false); }, 64030ms); // 7075ms } break; @@ -1013,7 +1013,7 @@ struct npc_akama_illidan : public ScriptedAI me->HandleEmoteCommand(EMOTE_ONESHOT_EXCLAMATION); }, 9530ms); // 2830ms me->m_Events.AddEventAtOffset([&] { - me->GetMotionMaster()->MovePath(PATH_AKAMA_MINIONS, false); + me->GetMotionMaster()->MoveWaypoint(PATH_AKAMA_MINIONS, false); }, 14400ms); // 4870ms } } diff --git a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_hydross_the_unstable.cpp b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_hydross_the_unstable.cpp index 060c627ee..9d277accd 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_hydross_the_unstable.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_hydross_the_unstable.cpp @@ -273,7 +273,7 @@ struct boss_hydross_the_unstable : public BossAI else if (summon->GetEntry() == NPC_TAINTED_HYDROSS_ELEMENTAL) { summon->setActive(true); - summon->GetMotionMaster()->MovePath(summon->GetEntry() * 10, false); + summon->GetMotionMaster()->MoveWaypoint(summon->GetEntry() * 10, false); } else { diff --git a/src/server/scripts/Outland/CoilfangReservoir/SlavePens/the_slave_pens.cpp b/src/server/scripts/Outland/CoilfangReservoir/SlavePens/the_slave_pens.cpp index 741a8e78f..c7e4525c8 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SlavePens/the_slave_pens.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SlavePens/the_slave_pens.cpp @@ -31,7 +31,7 @@ public: { if (Creature* quagmirran = instance->GetCreature(DATA_QUAGMIRRAN)) { - quagmirran->GetMotionMaster()->MovePath(quagmirran->GetEntry() * 100, true); + quagmirran->GetMotionMaster()->MoveWaypoint(quagmirran->GetEntry() * 100, true); } } diff --git a/src/server/scripts/Outland/CoilfangReservoir/underbog/boss_ghazan.cpp b/src/server/scripts/Outland/CoilfangReservoir/underbog/boss_ghazan.cpp index 0510e6b91..de200f256 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/underbog/boss_ghazan.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/underbog/boss_ghazan.cpp @@ -86,7 +86,7 @@ struct boss_ghazan : public BossAI if (type == ACTION_MOVE_TO_PLATFORM && !_movedToPlatform) { _movedToPlatform = true; - me->GetMotionMaster()->MovePath((me->GetSpawnId() * 10) + 1, false); + me->GetMotionMaster()->MoveWaypoint((me->GetSpawnId() * 10) + 1, false); } } diff --git a/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_porung.cpp b/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_porung.cpp index 77982ad4e..7af27eba7 100644 --- a/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_porung.cpp +++ b/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_porung.cpp @@ -100,7 +100,7 @@ struct npc_shattered_hand_scout : public ScriptedAI DoCastSelf(SPELL_CLEAR_ALL); me->SetUnitFlag(UNIT_FLAG_NOT_SELECTABLE); Talk(SAY_INVADERS_BREACHED); - me->GetMotionMaster()->MovePath(me->GetEntry() * 10, false); + me->GetMotionMaster()->MoveWaypoint(me->GetEntry() * 10, false); _firstZealots.clear(); std::list creatureList; diff --git a/src/server/scripts/Outland/TempestKeep/Eye/boss_alar.cpp b/src/server/scripts/Outland/TempestKeep/Eye/boss_alar.cpp index 57b86cae3..327664c2b 100644 --- a/src/server/scripts/Outland/TempestKeep/Eye/boss_alar.cpp +++ b/src/server/scripts/Outland/TempestKeep/Eye/boss_alar.cpp @@ -355,17 +355,7 @@ struct boss_alar : public BossAI void ConstructWaypointsAndMove() { me->StopMoving(); - if (WaypointPath const* i_path = sWaypointMgr->GetPath(me->GetWaypointPath())) - { - Movement::PointsArray pathPoints; - pathPoints.push_back(G3D::Vector3(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ())); - for (uint8 i = 0; i < i_path->size(); ++i) - { - WaypointData const* node = i_path->at(i); - pathPoints.push_back(G3D::Vector3(node->x, node->y, node->z)); - } - me->GetMotionMaster()->MoveSplinePath(&pathPoints); - } + me->GetMotionMaster()->MovePath(me->GetWaypointPath(), FORCED_MOVEMENT_NONE, PathSource::WAYPOINT_MGR); } void UpdateAI(uint32 diff) override diff --git a/src/server/scripts/Outland/zone_shadowmoon_valley.cpp b/src/server/scripts/Outland/zone_shadowmoon_valley.cpp index fe7d81d4e..5e31fb4f9 100644 --- a/src/server/scripts/Outland/zone_shadowmoon_valley.cpp +++ b/src/server/scripts/Outland/zone_shadowmoon_valley.cpp @@ -1860,22 +1860,22 @@ struct dragonmaw_race_npc : public ScriptedAI switch (me->GetEntry()) { case NPC_MUCKJAW: - me->GetMotionMaster()->MovePath(PATH_MUCKJAW, false); + me->GetMotionMaster()->MoveWaypoint(PATH_MUCKJAW, false); break; case NPC_TROPE: - me->GetMotionMaster()->MovePath(PATH_TROPE, false); + me->GetMotionMaster()->MoveWaypoint(PATH_TROPE, false); break; case NPC_CORLOK: - me->GetMotionMaster()->MovePath(PATH_CORLOK, false); + me->GetMotionMaster()->MoveWaypoint(PATH_CORLOK, false); break; case NPC_ICHMAN: - me->GetMotionMaster()->MovePath(PATH_ICHMAN, false); + me->GetMotionMaster()->MoveWaypoint(PATH_ICHMAN, false); break; case NPC_MULVERICK: - me->GetMotionMaster()->MovePath(PATH_MULVERICK, false); + me->GetMotionMaster()->MoveWaypoint(PATH_MULVERICK, false); break; case NPC_SKYSHATTER: - me->GetMotionMaster()->MovePath(PATH_SKYSHATTER, false); + me->GetMotionMaster()->MoveWaypoint(PATH_SKYSHATTER, false); break; default: break; From bdd4a122435093c0894f72a81edaa76ee3046b26 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 26 Oct 2025 17:07:05 +0000 Subject: [PATCH 11/28] chore(DB): import pending files Referenced commit(s): 6292f802199225ff2f02375d07eb4a92487cb438 --- .../rev_1760881893133517800.sql => db_world/2025_10_26_02.sql} | 1 + 1 file changed, 1 insertion(+) rename data/sql/updates/{pending_db_world/rev_1760881893133517800.sql => db_world/2025_10_26_02.sql} (94%) diff --git a/data/sql/updates/pending_db_world/rev_1760881893133517800.sql b/data/sql/updates/db_world/2025_10_26_02.sql similarity index 94% rename from data/sql/updates/pending_db_world/rev_1760881893133517800.sql rename to data/sql/updates/db_world/2025_10_26_02.sql index a831499ac..4a86fcbdc 100644 --- a/data/sql/updates/pending_db_world/rev_1760881893133517800.sql +++ b/data/sql/updates/db_world/2025_10_26_02.sql @@ -1,3 +1,4 @@ +-- DB update 2025_10_26_01 -> 2025_10_26_02 -- `point`s had gaps causing core code needing to be extra complicated UPDATE `waypoint_data` SET `point`=1 WHERE `id`=1336190 AND `point`=2 AND `action`=1336191; UPDATE `waypoint_data` SET `point`=2 WHERE `id`=1336190 AND `point`=4 AND `action`=1336192; From 4212b83d7c4913bffc44426fc4d0125bb13d0052 Mon Sep 17 00:00:00 2001 From: blinkysc <37940565+blinkysc@users.noreply.github.com> Date: Sun, 26 Oct 2025 14:32:44 -0500 Subject: [PATCH 12/28] fix(HoS/DB) Lightning construct now linked (#23398) Co-authored-by: John Doe --- .../sql/updates/pending_db_world/rev_1761401571384059169.sql | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 data/sql/updates/pending_db_world/rev_1761401571384059169.sql diff --git a/data/sql/updates/pending_db_world/rev_1761401571384059169.sql b/data/sql/updates/pending_db_world/rev_1761401571384059169.sql new file mode 100644 index 000000000..0c39e9316 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1761401571384059169.sql @@ -0,0 +1,5 @@ +-- +DELETE FROM `creature_formations` WHERE (`leaderGUID` = 126747) AND (`memberGUID` IN (126747, 126748)); +INSERT INTO `creature_formations` (`leaderGUID`, `memberGUID`, `dist`, `angle`, `groupAI`, `point_1`, `point_2`) VALUES +(126747, 126747, 0, 0, 3, 0, 0), +(126747, 126748, 0, 0, 3, 0, 0); From 9dd540752580dc9c57d06aec3117919f340252f6 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 26 Oct 2025 19:36:36 +0000 Subject: [PATCH 13/28] chore(DB): import pending files Referenced commit(s): 4212b83d7c4913bffc44426fc4d0125bb13d0052 --- .../rev_1761401571384059169.sql => db_world/2025_10_26_03.sql} | 1 + 1 file changed, 1 insertion(+) rename data/sql/updates/{pending_db_world/rev_1761401571384059169.sql => db_world/2025_10_26_03.sql} (86%) diff --git a/data/sql/updates/pending_db_world/rev_1761401571384059169.sql b/data/sql/updates/db_world/2025_10_26_03.sql similarity index 86% rename from data/sql/updates/pending_db_world/rev_1761401571384059169.sql rename to data/sql/updates/db_world/2025_10_26_03.sql index 0c39e9316..7c761b7f8 100644 --- a/data/sql/updates/pending_db_world/rev_1761401571384059169.sql +++ b/data/sql/updates/db_world/2025_10_26_03.sql @@ -1,3 +1,4 @@ +-- DB update 2025_10_26_02 -> 2025_10_26_03 -- DELETE FROM `creature_formations` WHERE (`leaderGUID` = 126747) AND (`memberGUID` IN (126747, 126748)); INSERT INTO `creature_formations` (`leaderGUID`, `memberGUID`, `dist`, `angle`, `groupAI`, `point_1`, `point_2`) VALUES From 48736cfc8934c30d0a2608e672114f9b2d7db308 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Francesco=20Borz=C3=AC?= Date: Sun, 26 Oct 2025 22:07:06 +0100 Subject: [PATCH 14/28] feat(CI): enable cache in dashboard checks (#23432) --- .github/workflows/dashboard-ci.yml | 123 +++++++++++++++++++++++++++++ 1 file changed, 123 insertions(+) diff --git a/.github/workflows/dashboard-ci.yml b/.github/workflows/dashboard-ci.yml index 67f805aac..9e92a909f 100644 --- a/.github/workflows/dashboard-ci.yml +++ b/.github/workflows/dashboard-ci.yml @@ -19,6 +19,10 @@ concurrency: group: ${{ github.head_ref }} || concat(${{ github.ref_name }}, ${{ github.workflow }}) cancel-in-progress: true +permissions: + actions: write + contents: read + env: CONTINUOUS_INTEGRATION: true MYSQL_ROOT_PASSWORD: root @@ -72,6 +76,113 @@ jobs: with: fetch-depth: 1 + - name: Install ccache + shell: bash + run: | + sudo apt-get update + sudo apt-get install -y ccache + ccache --version + + # Detect the compilers that acore.sh / CMake will end up using. + # We record both the binary name and a short version tag for the cache key. + - name: Detect compiler + id: detect + shell: bash + run: | + set -euo pipefail + CC_BIN="${CC:-}" + CXX_BIN="${CXX:-}" + [[ -z "$CC_BIN" ]] && CC_BIN="$(command -v clang || command -v gcc)" + [[ -z "$CXX_BIN" ]] && CXX_BIN="$(command -v clang++ || command -v g++)" + + make_ver_id() { + local bin="$1"; local base="$(basename "$bin")" + case "$base" in + clang) + maj="$("$bin" -dumpversion 2>/dev/null | cut -d. -f1)"; [[ -z "$maj" ]] && maj="$( "$bin" --version | sed -n 's/.*version \([0-9][0-9]*\).*/\1/p' | head -1 )" + echo "clang-${maj:-unknown}" + ;; + clang++) + maj="$("$bin" -dumpversion 2>/dev/null | cut -d. -f1)"; [[ -z "$maj" ]] && maj="$( "$bin" --version | sed -n 's/.*version \([0-9][0-9]*\).*/\1/p' | head -1 )" + echo "clang++-${maj:-unknown}" + ;; + gcc) + maj="$("$bin" -dumpfullversion -dumpversion 2>/dev/null || "$bin" -dumpversion 2>/dev/null)"; maj="${maj%%.*}" + echo "gcc-${maj:-unknown}" + ;; + g++) + maj="$("$bin" -dumpfullversion -dumpversion 2>/dev/null || "$bin" -dumpversion 2>/dev/null)"; maj="${maj%%.*}" + echo "g++-${maj:-unknown}" + ;; + *) + echo "$base" + ;; + esac + } + + echo "cc_id=$(make_ver_id "$CC_BIN")" >> "$GITHUB_OUTPUT" + echo "cxx_id=$(make_ver_id "$CXX_BIN")" >> "$GITHUB_OUTPUT" + echo "Detected: $CC_BIN, $CXX_BIN" + + - name: Prepare ccache dir + shell: bash + run: mkdir -p "${{ github.workspace }}/var/ccache" + + - name: Echo cache key + shell: bash + run: echo "Cache key -> ccache:${{ runner.os }}:${{ steps.detect.outputs.cc_id }}_${{ steps.detect.outputs.cxx_id }}:${{ github.ref_name }}" + + - name: Restore ccache + id: restore_ccache + uses: actions/cache/restore@v4 + with: + path: ${{ github.workspace }}/var/ccache + key: ccache:${{ runner.os }}:${{ steps.detect.outputs.cc_id }}_${{ steps.detect.outputs.cxx_id }}:${{ github.ref_name }} + restore-keys: | + ccache:${{ runner.os }}:${{ steps.detect.outputs.cc_id }}_${{ steps.detect.outputs.cxx_id }}:true:pch=false: + ccache:${{ runner.os }}:${{ steps.detect.outputs.cc_id }}_${{ steps.detect.outputs.cxx_id }}:false:pch=false: + ccache:${{ runner.os }}:${{ steps.detect.outputs.cc_id }}_${{ steps.detect.outputs.cxx_id }}:true:pch=true: + ccache:${{ runner.os }}:${{ steps.detect.outputs.cc_id }}_${{ steps.detect.outputs.cxx_id }}:false:pch=true: + ccache:${{ runner.os }}:${{ steps.detect.outputs.cc_id }}_${{ steps.detect.outputs.cxx_id }}:true: + ccache:${{ runner.os }}:${{ steps.detect.outputs.cc_id }}_${{ steps.detect.outputs.cxx_id }}:false: + ccache:${{ runner.os }}:${{ steps.detect.outputs.cc_id }}_${{ steps.detect.outputs.cxx_id }}: + + - name: Setup ccache env + shell: bash + env: + CCACHE_DIR: ${{ github.workspace }}/var/ccache + run: | + mkdir -p "$CCACHE_DIR" + cat <> "$GITHUB_ENV" + CCACHE_BASEDIR=${{ github.workspace }} + CCACHE_DIR=${{ github.workspace }}/var/ccache + CCACHE_HASHDIR=1 + CCACHE_MAXSIZE=5G + CCACHE_SLOPPINESS=pch_defines,time_macros,include_file_mtime + CCACHE_COMPRESS=1 + CCACHE_COMPRESSLEVEL=9 + CCACHE_COMPILERCHECK=content + CCACHE_LOGFILE=${{ github.workspace }}/var/ccache/cache.debug + CMAKE_C_COMPILER_LAUNCHER=ccache + CMAKE_CXX_COMPILER_LAUNCHER=ccache + EOF + + - name: ccache snapshot (before) + shell: bash + run: | + echo "==== Effective ccache configuration ====" + ccache -p | egrep 'base_dir|hash_dir|compiler_check|sloppiness|max_size' || true + echo + echo "==== Previous cache stats ====" + ccache -s || true + echo + echo "==== Top cache results (from prior runs) ====" + grep -o 'result: .*' "${{ github.workspace }}/var/ccache/cache.debug" 2>/dev/null | sort | uniq -c | sort -nr | head || true + + - name: Reset ccache stats + shell: bash + run: ccache -z || true + - name: Configure AzerothCore settings run: | touch conf/config.sh @@ -154,3 +265,15 @@ jobs: ./acore.sh sm delete authserver timeout-minutes: 30 continue-on-error: false + + # save only if we didn't hit the cache + - name: Save ccache + if: steps.restore_ccache.outputs.cache-hit != 'true' + uses: actions/cache/save@v4 + with: + path: ${{ github.workspace }}/var/ccache + key: ccache:${{ runner.os }}:${{ steps.detect.outputs.cc_id }}_${{ steps.detect.outputs.cxx_id }}:${{ github.ref_name }} + + - name: ccache stats (after) + shell: bash + run: ccache -s || true \ No newline at end of file From 13c6719104992ade141fc2dedfd248f23d5db631 Mon Sep 17 00:00:00 2001 From: killerwife Date: Mon, 27 Oct 2025 11:30:11 +0100 Subject: [PATCH 15/28] fix(Core/Arena): flying upon arrival in arena if joining on flying mount (#23440) --- src/server/game/Battlegrounds/Battleground.cpp | 9 ++++++--- src/server/game/Entities/Player/Player.cpp | 11 ----------- 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/src/server/game/Battlegrounds/Battleground.cpp b/src/server/game/Battlegrounds/Battleground.cpp index 7ddd4e87e..7b4b13613 100644 --- a/src/server/game/Battlegrounds/Battleground.cpp +++ b/src/server/game/Battlegrounds/Battleground.cpp @@ -1178,16 +1178,19 @@ void Battleground::AddPlayer(Player* player) sBattlegroundMgr->BuildPlayerJoinedBattlegroundPacket(&data, player); SendPacketToTeam(teamId, &data, player, false); - player->RemoveAurasByType(SPELL_AURA_MOUNTED); - // add arena specific auras if (isArena()) { // restore pets health before remove - if (Pet* pet = player->GetPet()) + Pet* pet = player->GetPet(); + if (pet) if (pet->IsAlive()) pet->SetHealth(pet->GetMaxHealth()); + player->RemoveArenaAuras(); + if (pet) + pet->RemoveArenaAuras(); + player->RemoveArenaSpellCooldowns(true); player->RemoveArenaEnchantments(TEMP_ENCHANTMENT_SLOT); player->DestroyConjuredItems(true); player->UnsummonPetTemporaryIfAny(); diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 9e481658b..0052f200f 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -1533,17 +1533,6 @@ bool Player::TeleportTo(uint32 mapid, float x, float y, float z, float orientati CombatStop(); - // remove arena spell coldowns/buffs now to also remove pet's cooldowns before it's temporarily unsummoned - if (mEntry->IsBattleArena() && (HasPendingSpectatorForBG(0) || !HasPendingSpectatorForBG(GetBattlegroundId()))) - { - // KEEP THIS ORDER! - RemoveArenaAuras(); - if (pet) - pet->RemoveArenaAuras(); - - RemoveArenaSpellCooldowns(true); - } - // remove pet on map change if (pet) UnsummonPetTemporaryIfAny(); From e6bf722ad476cb0653d6e9af11872aecfdefe075 Mon Sep 17 00:00:00 2001 From: blinkysc <37940565+blinkysc@users.noreply.github.com> Date: Tue, 28 Oct 2025 00:32:29 -0500 Subject: [PATCH 16/28] fix(DB/Creature): Hardened Steel Berserker now has windfury in heroic (#23430) --- data/sql/updates/pending_db_world/rev_1761496582139904291.sql | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 data/sql/updates/pending_db_world/rev_1761496582139904291.sql diff --git a/data/sql/updates/pending_db_world/rev_1761496582139904291.sql b/data/sql/updates/pending_db_world/rev_1761496582139904291.sql new file mode 100644 index 000000000..7aa4d0ce3 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1761496582139904291.sql @@ -0,0 +1,4 @@ +-- +DELETE FROM `creature_template_addon` WHERE (`entry` = 30966); +INSERT INTO `creature_template_addon` (`entry`, `path_id`, `mount`, `bytes1`, `bytes2`, `emote`, `visibilityDistanceType`, `auras`) VALUES +(30966, 0, 0, 0, 0, 0, 0, '61367'); From 8900f74b89ffd35cddf02a2105d1614ca448a342 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 28 Oct 2025 05:33:31 +0000 Subject: [PATCH 17/28] chore(DB): import pending files Referenced commit(s): e6bf722ad476cb0653d6e9af11872aecfdefe075 --- .../rev_1761496582139904291.sql => db_world/2025_10_28_00.sql} | 1 + 1 file changed, 1 insertion(+) rename data/sql/updates/{pending_db_world/rev_1761496582139904291.sql => db_world/2025_10_28_00.sql} (84%) diff --git a/data/sql/updates/pending_db_world/rev_1761496582139904291.sql b/data/sql/updates/db_world/2025_10_28_00.sql similarity index 84% rename from data/sql/updates/pending_db_world/rev_1761496582139904291.sql rename to data/sql/updates/db_world/2025_10_28_00.sql index 7aa4d0ce3..729cda874 100644 --- a/data/sql/updates/pending_db_world/rev_1761496582139904291.sql +++ b/data/sql/updates/db_world/2025_10_28_00.sql @@ -1,3 +1,4 @@ +-- DB update 2025_10_26_03 -> 2025_10_28_00 -- DELETE FROM `creature_template_addon` WHERE (`entry` = 30966); INSERT INTO `creature_template_addon` (`entry`, `path_id`, `mount`, `bytes1`, `bytes2`, `emote`, `visibilityDistanceType`, `auras`) VALUES From fd497521b769491136f3f3a31b89aa646a9064af Mon Sep 17 00:00:00 2001 From: blinkysc <37940565+blinkysc@users.noreply.github.com> Date: Tue, 28 Oct 2025 04:41:04 -0500 Subject: [PATCH 18/28] fix(SAI/HoS) Lightning Construct Electrical Overload timings in combat (#23408) Co-authored-by: John Doe --- .../updates/pending_db_world/rev_1761415986147398675.sql | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 data/sql/updates/pending_db_world/rev_1761415986147398675.sql diff --git a/data/sql/updates/pending_db_world/rev_1761415986147398675.sql b/data/sql/updates/pending_db_world/rev_1761415986147398675.sql new file mode 100644 index 000000000..62765cf46 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1761415986147398675.sql @@ -0,0 +1,8 @@ +-- +UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = 27972; +DELETE FROM `smart_scripts` WHERE (`source_type` = 0 AND `entryorguid` = 27972); +INSERT INTO `smart_scripts` (`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_param6`, `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`, `comment`) VALUES +(27972, 0, 0, 0, 0, 0, 100, 2, 3000, 6000, 9000, 15000, 0, 0, 11, 52383, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 'Lightning Construct - In Combat - Cast \'Chain Lightning\' (No Repeat) (Dungeon/Normal)'), +(27972, 0, 1, 0, 0, 0, 100, 4, 3000, 6000, 9000, 15000, 0, 0, 11, 61528, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 'Lightning Construct - In Combat - Cast \'Chain Lightning\' (No Repeat) (Dungeon/Heroic)'), +(27972, 0, 2, 0, 0, 0, 100, 515, 7000, 28000, 14000, 27000, 0, 0, 11, 52341, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Lightning Construct - On Just Died - Cast \'Electrical Overload\' (Dungeon/Normal)'), +(27972, 0, 3, 0, 0, 0, 100, 517, 7000, 28000, 14000, 27000, 0, 0, 11, 59038, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Lightning Construct - On Just Died - Cast \'Electrical Overload\' (Dungeon/Heroic)'); From e00f707777c36d5e3e58d9a752aecda4012d41b1 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 28 Oct 2025 09:42:15 +0000 Subject: [PATCH 19/28] chore(DB): import pending files Referenced commit(s): fd497521b769491136f3f3a31b89aa646a9064af --- .../rev_1761415986147398675.sql => db_world/2025_10_28_01.sql} | 1 + 1 file changed, 1 insertion(+) rename data/sql/updates/{pending_db_world/rev_1761415986147398675.sql => db_world/2025_10_28_01.sql} (97%) diff --git a/data/sql/updates/pending_db_world/rev_1761415986147398675.sql b/data/sql/updates/db_world/2025_10_28_01.sql similarity index 97% rename from data/sql/updates/pending_db_world/rev_1761415986147398675.sql rename to data/sql/updates/db_world/2025_10_28_01.sql index 62765cf46..701516fe7 100644 --- a/data/sql/updates/pending_db_world/rev_1761415986147398675.sql +++ b/data/sql/updates/db_world/2025_10_28_01.sql @@ -1,3 +1,4 @@ +-- DB update 2025_10_28_00 -> 2025_10_28_01 -- UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = 27972; DELETE FROM `smart_scripts` WHERE (`source_type` = 0 AND `entryorguid` = 27972); From 7e5a28b064f30da07ba7100190cf1559cd189226 Mon Sep 17 00:00:00 2001 From: killerwife Date: Tue, 28 Oct 2025 10:49:51 +0100 Subject: [PATCH 20/28] SmartAI: Fix npcs not waypointing when offset is too big (#23453) --- src/server/game/AI/SmartScripts/SmartAI.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/server/game/AI/SmartScripts/SmartAI.cpp b/src/server/game/AI/SmartScripts/SmartAI.cpp index e799c923c..198c7adb4 100644 --- a/src/server/game/AI/SmartScripts/SmartAI.cpp +++ b/src/server/game/AI/SmartScripts/SmartAI.cpp @@ -157,15 +157,14 @@ void SmartAI::GenerateWayPointArray(Movement::PointsArray* points) pVector.push_back(G3D::Vector3(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ())); uint32 wpCounter = mCurrentWPID; - auto itr = mWayPoints->find(wpCounter++); - do + uint32 length = (mWayPoints->size() - mCurrentWPID) * size; + + uint32 cnt = 0; + for (auto itr = mWayPoints->find(wpCounter); itr != mWayPoints->end() && cnt++ <= length; ++itr) { WaypointData const& wp = (*itr).second; pVector.push_back(G3D::Vector3(wp.x, wp.y, wp.z)); - - itr = mWayPoints->find(wpCounter++); } - while (itr != mWayPoints->end()); if (pVector.size() > 2) // more than source + dest { From 3b9c91e9dc803f9862c256859291aa94a7b93cc3 Mon Sep 17 00:00:00 2001 From: blinkysc <37940565+blinkysc@users.noreply.github.com> Date: Tue, 28 Oct 2025 05:35:10 -0500 Subject: [PATCH 21/28] fix(DB/HoL) Hardened Steel Reaver Heroic Dull Weapons aura in addon (#23426) Co-authored-by: John Doe Co-authored-by: blinkysc --- data/sql/updates/pending_db_world/rev_1761489241255958762.sql | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 data/sql/updates/pending_db_world/rev_1761489241255958762.sql diff --git a/data/sql/updates/pending_db_world/rev_1761489241255958762.sql b/data/sql/updates/pending_db_world/rev_1761489241255958762.sql new file mode 100644 index 000000000..97ae5eb8e --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1761489241255958762.sql @@ -0,0 +1,4 @@ +-- +DELETE FROM `creature_template_addon` WHERE (`entry` = 30967); +INSERT INTO `creature_template_addon` (`entry`, `path_id`, `mount`, `bytes1`, `bytes2`, `emote`, `visibilityDistanceType`, `auras`) VALUES +(30967, 0, 0, 0, 0, 0, 0, '59143'); From b8c4d5cdac48404d5ae4bc519501fd3b2e33e124 Mon Sep 17 00:00:00 2001 From: blinkysc <37940565+blinkysc@users.noreply.github.com> Date: Tue, 28 Oct 2025 05:35:51 -0500 Subject: [PATCH 22/28] fix(DB/HoL) Blistering Streamrager has Scald in heroic (#23431) Co-authored-by: John Doe --- data/sql/updates/pending_db_world/rev_1761497011199327897.sql | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 data/sql/updates/pending_db_world/rev_1761497011199327897.sql diff --git a/data/sql/updates/pending_db_world/rev_1761497011199327897.sql b/data/sql/updates/pending_db_world/rev_1761497011199327897.sql new file mode 100644 index 000000000..34efb5ce8 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1761497011199327897.sql @@ -0,0 +1,4 @@ +-- +DELETE FROM `creature_template_addon` WHERE (`entry` = 30964); +INSERT INTO `creature_template_addon` (`entry`, `path_id`, `mount`, `bytes1`, `bytes2`, `emote`, `visibilityDistanceType`, `auras`) VALUES +(30964, 0, 0, 0, 0, 0, 0, '59140'); From d620d5103d88af9d59975069f0326c2f2dad3fd3 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 28 Oct 2025 10:36:14 +0000 Subject: [PATCH 23/28] chore(DB): import pending files Referenced commit(s): 3b9c91e9dc803f9862c256859291aa94a7b93cc3 --- .../rev_1761489241255958762.sql => db_world/2025_10_28_02.sql} | 1 + .../rev_1761497011199327897.sql => db_world/2025_10_28_03.sql} | 1 + 2 files changed, 2 insertions(+) rename data/sql/updates/{pending_db_world/rev_1761489241255958762.sql => db_world/2025_10_28_02.sql} (84%) rename data/sql/updates/{pending_db_world/rev_1761497011199327897.sql => db_world/2025_10_28_03.sql} (84%) diff --git a/data/sql/updates/pending_db_world/rev_1761489241255958762.sql b/data/sql/updates/db_world/2025_10_28_02.sql similarity index 84% rename from data/sql/updates/pending_db_world/rev_1761489241255958762.sql rename to data/sql/updates/db_world/2025_10_28_02.sql index 97ae5eb8e..0874f8cc5 100644 --- a/data/sql/updates/pending_db_world/rev_1761489241255958762.sql +++ b/data/sql/updates/db_world/2025_10_28_02.sql @@ -1,3 +1,4 @@ +-- DB update 2025_10_28_01 -> 2025_10_28_02 -- DELETE FROM `creature_template_addon` WHERE (`entry` = 30967); INSERT INTO `creature_template_addon` (`entry`, `path_id`, `mount`, `bytes1`, `bytes2`, `emote`, `visibilityDistanceType`, `auras`) VALUES diff --git a/data/sql/updates/pending_db_world/rev_1761497011199327897.sql b/data/sql/updates/db_world/2025_10_28_03.sql similarity index 84% rename from data/sql/updates/pending_db_world/rev_1761497011199327897.sql rename to data/sql/updates/db_world/2025_10_28_03.sql index 34efb5ce8..747748e7e 100644 --- a/data/sql/updates/pending_db_world/rev_1761497011199327897.sql +++ b/data/sql/updates/db_world/2025_10_28_03.sql @@ -1,3 +1,4 @@ +-- DB update 2025_10_28_02 -> 2025_10_28_03 -- DELETE FROM `creature_template_addon` WHERE (`entry` = 30964); INSERT INTO `creature_template_addon` (`entry`, `path_id`, `mount`, `bytes1`, `bytes2`, `emote`, `visibilityDistanceType`, `auras`) VALUES From b74dc4961ccb5add21bbf6d96f3a49bb9787a6e6 Mon Sep 17 00:00:00 2001 From: Rocco Silipo <108557877+Rorschach91@users.noreply.github.com> Date: Tue, 28 Oct 2025 14:32:12 +0100 Subject: [PATCH 24/28] fix(DB/AI): Update Thousand Needles racing event (#23417) --- .../Thousand_needles_racing.sql | 577 ++++++++++++++++++ 1 file changed, 577 insertions(+) create mode 100644 data/sql/updates/pending_db_world/Thousand_needles_racing.sql diff --git a/data/sql/updates/pending_db_world/Thousand_needles_racing.sql b/data/sql/updates/pending_db_world/Thousand_needles_racing.sql new file mode 100644 index 000000000..1b0f677b7 --- /dev/null +++ b/data/sql/updates/pending_db_world/Thousand_needles_racing.sql @@ -0,0 +1,577 @@ + +-- Set Waypoint (Goblin Racer) +DELETE FROM `waypoints` WHERE (`entry` IN (425100, 425101, 425102)); + +DELETE FROM `waypoint_data` WHERE (`id` IN (425100, 425101, 425102)); +INSERT INTO `waypoint_data` (`id`, `point`, `position_x`, `position_y`, `position_z`, `orientation`, `delay`, `move_type`, `action`, `action_chance`, `wpguid`) VALUES +(425100, 1, -6225.51, -3941.11, -58.7498, NULL, 0, 0, 0, 100, 0), +(425100, 2, -6236.21, -3935.4, -58.7498, NULL, 0, 0, 0, 100, 0), +(425100, 3, -6247.18, -3931.45, -58.7498, NULL, 0, 0, 0, 100, 0), +(425100, 4, -6258.18, -3927.22, -58.7498, NULL, 0, 0, 0, 100, 0), +(425100, 5, -6269.23, -3923.11, -58.7547, NULL, 0, 0, 0, 100, 0), +(425100, 6, -6279.39, -3918.62, -59.3734, NULL, 0, 0, 0, 100, 0), +(425100, 7, -6282.4, -3913.51, -60.9864, NULL, 0, 0, 0, 100, 0), +(425100, 8, -6281.27, -3907.82, -62.2515, NULL, 0, 0, 0, 100, 0), +(425100, 9, -6275.9, -3905.8, -62.1365, NULL, 0, 0, 0, 100, 0), +(425100, 10, -6263.77, -3905.9, -61.6845, NULL, 0, 0, 0, 100, 0), +(425100, 11, -6253.39, -3906.03, -61.3059, NULL, 0, 0, 0, 100, 0), +(425100, 12, -6239.63, -3906.45, -60.7614, NULL, 0, 0, 0, 100, 0), +(425100, 13, -6225.17, -3906.85, -60.5172, NULL, 0, 0, 0, 100, 0), +(425100, 14, -6210.59, -3906.98, -60.3689, NULL, 0, 0, 0, 100, 0), +(425100, 15, -6199.5, -3906.93, -60.2643, NULL, 0, 0, 0, 100, 0), +(425101, 1, -6191.34, -3907.16, -60.1596, NULL, 0, 1, 0, 100, 0), +(425101, 2, -6182.71, -3907.32, -60.0754, NULL, 0, 1, 0, 100, 0), +(425101, 3, -6173.72, -3907.54, -59.989, NULL, 0, 1, 0, 100, 0), +(425101, 4, -6165.55, -3907.61, -59.9135, NULL, 0, 1, 0, 100, 0), +(425101, 5, -6157.03, -3907.58, -59.8541, NULL, 0, 1, 0, 100, 0), +(425101, 6, -6149.33, -3907.56, -59.869, NULL, 0, 1, 0, 100, 0), +(425101, 7, -6141.87, -3907.27, -59.8809, NULL, 0, 1, 0, 100, 0), +(425101, 8, -6134.19, -3906.66, -59.8966, NULL, 0, 1, 0, 100, 0), +(425101, 9, -6126.41, -3906, -59.9151, NULL, 0, 1, 0, 100, 0), +(425101, 10, -6118.21, -3904.83, -59.9276, NULL, 0, 1, 0, 100, 0), +(425101, 11, -6109.64, -3903.1, -59.9142, NULL, 0, 1, 0, 100, 0), +(425101, 12, -6101.99, -3900.99, -59.8983, NULL, 0, 1, 0, 100, 0), +(425101, 13, -6094.14, -3898.34, -59.9102, NULL, 0, 1, 0, 100, 0), +(425101, 14, -6086.04, -3895.35, -59.9533, NULL, 0, 1, 0, 100, 0), +(425101, 15, -6078.54, -3892.43, -60.0029, NULL, 0, 1, 0, 100, 0), +(425101, 16, -6071.29, -3889.5, -60.0037, NULL, 0, 1, 0, 100, 0), +(425101, 17, -6064.36, -3886.7, -60.0814, NULL, 0, 1, 0, 100, 0), +(425101, 18, -6056.71, -3883.55, -60.0903, NULL, 0, 1, 0, 100, 0), +(425101, 19, -6048.43, -3880.06, -60.0819, NULL, 0, 1, 0, 100, 0), +(425101, 20, -6041.12, -3876.97, -60.2107, NULL, 0, 1, 0, 100, 0), +(425101, 21, -6033.99, -3873.77, -60.2425, NULL, 0, 1, 0, 100, 0), +(425101, 22, -6026.41, -3870.14, -60.3019, NULL, 0, 1, 0, 100, 0), +(425101, 23, -6018.84, -3866.51, -60.3987, NULL, 0, 1, 0, 100, 0), +(425101, 24, -6010.52, -3862.53, -60.463, NULL, 0, 1, 0, 100, 0), +(425101, 25, -6001.92, -3858.92, -60.4977, NULL, 0, 1, 0, 100, 0), +(425101, 26, -5994, -3855.5, -60.537, NULL, 0, 1, 0, 100, 0), +(425101, 27, -5986.28, -3852.17, -60.5544, NULL, 0, 1, 0, 100, 0), +(425101, 28, -5977.79, -3848.58, -60.6569, NULL, 0, 1, 0, 100, 0), +(425101, 29, -5969.48, -3845.51, -60.6788, NULL, 0, 1, 0, 100, 0), +(425101, 30, -5961.47, -3842.31, -60.6862, NULL, 0, 1, 0, 100, 0), +(425101, 31, -5953.81, -3838.1, -60.7637, NULL, 0, 1, 0, 100, 0), +(425101, 32, -5946.88, -3833.78, -60.7016, NULL, 0, 1, 0, 100, 0), +(425101, 33, -5939.37, -3828.83, -60.5285, NULL, 0, 1, 0, 100, 0), +(425101, 34, -5932.05, -3824.73, -60.3301, NULL, 0, 1, 0, 100, 0), +(425101, 35, -5924.41, -3820.69, -60.1505, NULL, 0, 1, 0, 100, 0), +(425101, 36, -5916.7, -3816.31, -59.9721, NULL, 0, 1, 0, 100, 0), +(425101, 37, -5908.94, -3811.77, -59.7802, NULL, 0, 1, 0, 100, 0), +(425101, 38, -5901.17, -3807.78, -59.599, NULL, 0, 1, 0, 100, 0), +(425101, 39, -5892.77, -3803.96, -59.7475, NULL, 0, 1, 0, 100, 0), +(425101, 40, -5884.03, -3800.4, -59.9015, NULL, 0, 1, 0, 100, 0), +(425101, 41, -5875.09, -3797.35, -59.7717, NULL, 0, 1, 0, 100, 0), +(425101, 42, -5866.7, -3794.49, -59.9663, NULL, 0, 1, 0, 100, 0), +(425101, 43, -5857.66, -3791.74, -60.0965, NULL, 0, 1, 0, 100, 0), +(425101, 44, -5848.34, -3789.6, -60.2175, NULL, 0, 1, 0, 100, 0), +(425101, 45, -5838.75, -3788.36, -60.7136, NULL, 0, 1, 0, 100, 0), +(425101, 46, -5829.42, -3788.33, -61.4276, NULL, 0, 1, 0, 100, 0), +(425101, 47, -5819.15, -3788.47, -61.2672, NULL, 0, 1, 0, 100, 0), +(425101, 48, -5808.65, -3788.6, -61.2449, NULL, 0, 1, 0, 100, 0), +(425101, 49, -5799.44, -3788.72, -61.4032, NULL, 0, 1, 0, 100, 0), +(425101, 50, -5790.11, -3788.86, -61.5079, NULL, 0, 1, 0, 100, 0), +(425101, 51, -5780.1, -3789.52, -61.7291, NULL, 0, 1, 0, 100, 0), +(425101, 52, -5770.1, -3790.31, -61.6892, NULL, 0, 1, 0, 100, 0), +(425101, 53, -5760.91, -3791.05, -61.4138, NULL, 0, 1, 0, 100, 0), +(425101, 54, -5751.14, -3791.82, -61.2425, NULL, 0, 1, 0, 100, 0), +(425101, 55, -5741.44, -3793.19, -60.7875, NULL, 0, 1, 0, 100, 0), +(425101, 56, -5731.58, -3795.02, -60.5013, NULL, 0, 1, 0, 100, 0), +(425101, 57, -5722.71, -3797.45, -60.7248, NULL, 0, 1, 0, 100, 0), +(425101, 58, -5714.12, -3801.59, -60.7033, NULL, 0, 1, 0, 100, 0), +(425101, 59, -5705.75, -3807.33, -61.276, NULL, 0, 1, 0, 100, 0), +(425101, 60, -5698.13, -3813.49, -61.5311, NULL, 0, 1, 0, 100, 0), +(425101, 61, -5690.2, -3821.38, -61.8514, NULL, 0, 1, 0, 100, 0), +(425101, 62, -5683.57, -3828.12, -62.058, NULL, 0, 1, 0, 100, 0), +(425101, 63, -5676.96, -3836.11, -62.4184, NULL, 0, 1, 0, 100, 0), +(425101, 64, -5672.08, -3844.19, -62.5536, NULL, 0, 1, 0, 100, 0), +(425101, 65, -5667.64, -3852.92, -62.3648, NULL, 0, 1, 0, 100, 0), +(425101, 66, -5663.64, -3861.98, -62.1911, NULL, 0, 1, 0, 100, 0), +(425101, 67, -5660.23, -3870.42, -62.0313, NULL, 0, 1, 0, 100, 0), +(425101, 68, -5656.72, -3879.57, -61.9076, NULL, 0, 1, 0, 100, 0), +(425101, 69, -5653.92, -3888.84, -61.8135, NULL, 0, 1, 0, 100, 0), +(425101, 70, -5652.15, -3898.59, -61.7162, NULL, 0, 1, 0, 100, 0), +(425101, 71, -5651.03, -3908.67, -61.5772, NULL, 0, 1, 0, 100, 0), +(425101, 72, -5650.91, -3918.93, -61.4799, NULL, 0, 1, 0, 100, 0), +(425101, 73, -5651.61, -3929.06, -61.3575, NULL, 0, 1, 0, 100, 0), +(425101, 74, -5652.3, -3939.18, -61.2442, NULL, 0, 1, 0, 100, 0), +(425101, 75, -5652.61, -3949.91, -61.1983, NULL, 0, 1, 0, 100, 0), +(425101, 76, -5652.73, -3960.29, -61.1905, NULL, 0, 1, 0, 100, 0), +(425101, 77, -5652.62, -3969.86, -61.1821, NULL, 0, 1, 0, 100, 0), +(425101, 78, -5652.49, -3980, -61.1733, NULL, 0, 1, 0, 100, 0), +(425101, 79, -5652.18, -3989.45, -61.1665, NULL, 0, 1, 0, 100, 0), +(425101, 80, -5651.97, -3999, -61.1476, NULL, 0, 1, 0, 100, 0), +(425101, 81, -5652.08, -4007.87, -61.1334, NULL, 0, 1, 0, 100, 0), +(425101, 82, -5652.02, -4017.67, -61.138, NULL, 0, 1, 0, 100, 0), +(425101, 83, -5651.95, -4027.7, -61.1301, NULL, 0, 1, 0, 100, 0), +(425101, 84, -5651.95, -4037.85, -61.1205, NULL, 0, 1, 0, 100, 0), +(425101, 85, -5652.04, -4048.35, -61.1178, NULL, 0, 1, 0, 100, 0), +(425101, 86, -5652.13, -4058.26, -61.198, NULL, 0, 1, 0, 100, 0), +(425101, 87, -5652.52, -4068.28, -61.2569, NULL, 0, 1, 0, 100, 0), +(425101, 88, -5652.11, -4077.77, -61.325, NULL, 0, 1, 0, 100, 0), +(425101, 89, -5651.96, -4088.15, -61.4121, NULL, 0, 1, 0, 100, 0), +(425101, 90, -5652.17, -4098.18, -61.4581, NULL, 0, 1, 0, 100, 0), +(425101, 91, -5654.03, -4107.79, -61.4934, NULL, 0, 1, 0, 100, 0), +(425101, 92, -5657.23, -4117.03, -61.52, NULL, 0, 1, 0, 100, 0), +(425101, 93, -5661.96, -4126.92, -61.5754, NULL, 0, 1, 0, 100, 0), +(425101, 94, -5667.81, -4136.45, -61.6158, NULL, 0, 1, 0, 100, 0), +(425101, 95, -5674.38, -4145.07, -61.4887, NULL, 0, 1, 0, 100, 0), +(425101, 96, -5681.9, -4152.55, -61.1095, NULL, 0, 1, 0, 100, 0), +(425101, 97, -5689.64, -4159.46, -60.7022, NULL, 0, 1, 0, 100, 0), +(425101, 98, -5697.77, -4165.15, -60.3832, NULL, 0, 1, 0, 100, 0), +(425101, 99, -5707.17, -4170.99, -60.7134, NULL, 0, 1, 0, 100, 0), +(425101, 100, -5717.18, -4175.44, -60.9908, NULL, 0, 1, 0, 100, 0), +(425101, 101, -5727.36, -4179.17, -61.2624, NULL, 0, 1, 0, 100, 0), +(425101, 102, -5738.05, -4182.49, -61.3718, NULL, 0, 1, 0, 100, 0), +(425101, 103, -5749.12, -4185.79, -61.4358, NULL, 0, 1, 0, 100, 0), +(425101, 104, -5760.01, -4188.84, -61.4949, NULL, 0, 1, 0, 100, 0), +(425101, 105, -5771, -4191.55, -61.5739, NULL, 0, 1, 0, 100, 0), +(425101, 106, -5782.2, -4193.87, -61.4574, NULL, 0, 1, 0, 100, 0), +(425101, 107, -5793.75, -4195.5, -61.2659, NULL, 0, 1, 0, 100, 0), +(425101, 108, -5804.87, -4196.79, -61.4307, NULL, 0, 1, 0, 100, 0), +(425101, 109, -5816.49, -4197.87, -61.7136, NULL, 0, 1, 0, 100, 0), +(425101, 110, -5827.89, -4198.71, -61.9537, NULL, 0, 1, 0, 100, 0), +(425101, 111, -5838.83, -4199.43, -62.2257, NULL, 0, 1, 0, 100, 0), +(425101, 112, -5860.84, -4200.84, -62.6325, NULL, 0, 1, 0, 100, 0), +(425101, 113, -5871.57, -4201.42, -62.6989, NULL, 0, 1, 0, 100, 0), +(425101, 114, -5882.64, -4202.02, -62.7864, NULL, 0, 1, 0, 100, 0), +(425101, 115, -5892.89, -4202.57, -62.8554, NULL, 0, 1, 0, 100, 0), +(425101, 116, -5904.42, -4203.16, -62.9321, NULL, 0, 1, 0, 100, 0), +(425101, 117, -5915.38, -4203.5, -62.8121, NULL, 0, 1, 0, 100, 0), +(425101, 118, -5925.06, -4203.69, -62.6909, NULL, 0, 1, 0, 100, 0), +(425101, 119, -5935.91, -4203.8, -62.5702, NULL, 0, 1, 0, 100, 0), +(425101, 120, -5946.41, -4203.92, -62.4459, NULL, 0, 1, 0, 100, 0), +(425101, 121, -5956.56, -4203.88, -62.3288, NULL, 0, 1, 0, 100, 0), +(425101, 122, -5967.76, -4203.6, -62.2098, NULL, 0, 1, 0, 100, 0), +(425101, 123, -5978.13, -4203.21, -62.2635, NULL, 0, 1, 0, 100, 0), +(425101, 124, -5988.37, -4202.45, -62.3194, NULL, 0, 1, 0, 100, 0), +(425101, 125, -5999.3, -4201.53, -62.3791, NULL, 0, 1, 0, 100, 0), +(425101, 126, -6009.4, -4200.55, -62.4333, NULL, 0, 1, 0, 100, 0), +(425101, 127, -6019.49, -4199.46, -62.5019, NULL, 0, 1, 0, 100, 0), +(425101, 128, -6030.61, -4198.15, -62.561, NULL, 0, 1, 0, 100, 0), +(425101, 129, -6041.04, -4196.91, -62.6382, NULL, 0, 1, 0, 100, 0), +(425101, 130, -6051.82, -4195.7, -62.6637, NULL, 0, 1, 0, 100, 0), +(425101, 131, -6061.92, -4194.74, -62.4942, NULL, 0, 1, 0, 100, 0), +(425101, 132, -6072.04, -4193.86, -62.2556, NULL, 0, 1, 0, 100, 0), +(425101, 133, -6082.05, -4193.19, -62.0819, NULL, 0, 1, 0, 100, 0), +(425101, 134, -6090.91, -4192.73, -62.0193, NULL, 0, 1, 0, 100, 0), +(425101, 135, -6101.39, -4192.19, -62.2437, NULL, 0, 1, 0, 100, 0), +(425101, 136, -6111.76, -4191.65, -62.4711, NULL, 0, 1, 0, 100, 0), +(425101, 137, -6121.08, -4191.3, -62.6608, NULL, 0, 1, 0, 100, 0), +(425101, 138, -6132.16, -4191.27, -62.4196, NULL, 0, 1, 0, 100, 0), +(425101, 139, -6142.66, -4191.63, -62.1792, NULL, 0, 1, 0, 100, 0), +(425101, 140, -6152.66, -4192.38, -61.9736, NULL, 0, 1, 0, 100, 0), +(425101, 141, -6163.01, -4193.25, -61.7382, NULL, 0, 1, 0, 100, 0), +(425101, 142, -6173, -4194.25, -61.7186, NULL, 0, 1, 0, 100, 0), +(425101, 143, -6183.19, -4195.51, -61.6798, NULL, 0, 1, 0, 100, 0), +(425101, 144, -6194.04, -4197.1, -61.656, NULL, 0, 1, 0, 100, 0), +(425101, 145, -6204.15, -4198.82, -61.6283, NULL, 0, 1, 0, 100, 0), +(425101, 146, -6214.13, -4200.68, -61.5886, NULL, 0, 1, 0, 100, 0), +(425101, 147, -6224.52, -4203.34, -61.6324, NULL, 0, 1, 0, 100, 0), +(425101, 148, -6234.1, -4205.92, -61.6652, NULL, 0, 1, 0, 100, 0), +(425101, 149, -6244.13, -4208.61, -61.7164, NULL, 0, 1, 0, 100, 0), +(425101, 150, -6254.01, -4210.92, -61.7196, NULL, 0, 1, 0, 100, 0), +(425101, 151, -6263.09, -4212.42, -61.6526, NULL, 0, 1, 0, 100, 0), +(425101, 152, -6272.89, -4213.83, -61.57, NULL, 0, 1, 0, 100, 0), +(425101, 153, -6283.78, -4215.15, -61.4885, NULL, 0, 1, 0, 100, 0), +(425101, 154, -6293.67, -4215.9, -61.4038, NULL, 0, 1, 0, 100, 0), +(425101, 155, -6302.76, -4215.79, -61.3312, NULL, 0, 1, 0, 100, 0), +(425101, 156, -6312.99, -4214.93, -61.7428, NULL, 0, 1, 0, 100, 0), +(425101, 157, -6323.21, -4213.14, -62.2589, NULL, 0, 1, 0, 100, 0), +(425101, 158, -6332.36, -4211.33, -62.8202, NULL, 0, 1, 0, 100, 0), +(425101, 159, -6340.83, -4209.17, -62.4751, NULL, 0, 1, 0, 100, 0), +(425101, 160, -6348.46, -4205.71, -61.8554, NULL, 0, 1, 0, 100, 0), +(425101, 161, -6356.22, -4200.75, -61.2628, NULL, 0, 1, 0, 100, 0), +(425101, 162, -6363.98, -4194.96, -61.3468, NULL, 0, 1, 0, 100, 0), +(425101, 163, -6371.92, -4188.64, -61.855, NULL, 0, 1, 0, 100, 0), +(425101, 164, -6379.53, -4182.48, -62.2341, NULL, 0, 1, 0, 100, 0), +(425101, 165, -6387.53, -4175.85, -62.655, NULL, 0, 1, 0, 100, 0), +(425101, 166, -6394.59, -4168.89, -62.8009, NULL, 0, 1, 0, 100, 0), +(425101, 167, -6400.52, -4161.42, -63.097, NULL, 0, 1, 0, 100, 0), +(425101, 168, -6404.69, -4152.82, -63.3336, NULL, 0, 1, 0, 100, 0), +(425101, 169, -6408.46, -4143.78, -63.5631, NULL, 0, 1, 0, 100, 0), +(425101, 170, -6412.27, -4134.38, -63.8068, NULL, 0, 1, 0, 100, 0), +(425101, 171, -6415.74, -4124.6, -63.6947, NULL, 0, 1, 0, 100, 0), +(425101, 172, -6418.75, -4114.66, -63.841, NULL, 0, 1, 0, 100, 0), +(425101, 173, -6421.09, -4104.91, -63.7418, NULL, 0, 1, 0, 100, 0), +(425101, 174, -6423.35, -4094.54, -63.688, NULL, 0, 1, 0, 100, 0), +(425101, 175, -6425.45, -4084.97, -63.5708, NULL, 0, 1, 0, 100, 0), +(425101, 176, -6426.82, -4075.04, -63.2059, NULL, 0, 1, 0, 100, 0), +(425101, 177, -6427.49, -4064.33, -63.4149, NULL, 0, 1, 0, 100, 0), +(425101, 178, -6427.68, -4054.65, -63.3226, NULL, 0, 1, 0, 100, 0), +(425101, 179, -6427.67, -4044.38, -63.2196, NULL, 0, 1, 0, 100, 0), +(425101, 180, -6427.39, -4034.11, -63.1251, NULL, 0, 1, 0, 100, 0), +(425101, 181, -6427.07, -4024.21, -63.0233, NULL, 0, 1, 0, 100, 0), +(425101, 182, -6426.55, -4015.01, -62.9283, NULL, 0, 1, 0, 100, 0), +(425101, 183, -6425.56, -4004.91, -62.8437, NULL, 0, 1, 0, 100, 0), +(425101, 184, -6424.53, -3995.99, -62.8444, NULL, 0, 1, 0, 100, 0), +(425101, 185, -6423.09, -3986.18, -62.8394, NULL, 0, 1, 0, 100, 0), +(425101, 186, -6421.28, -3975.36, -62.8359, NULL, 0, 1, 0, 100, 0), +(425101, 187, -6418.93, -3966.08, -62.8326, NULL, 0, 1, 0, 100, 0), +(425101, 188, -6416.2, -3956.43, -62.8061, NULL, 0, 1, 0, 100, 0), +(425101, 189, -6412.62, -3946.94, -62.6365, NULL, 0, 1, 0, 100, 0), +(425101, 190, -6407.84, -3937.73, -62.266, NULL, 0, 1, 0, 100, 0), +(425101, 191, -6401.56, -3927.91, -61.9102, NULL, 0, 1, 0, 100, 0), +(425101, 192, -6395.28, -3919.51, -61.6526, NULL, 0, 1, 0, 100, 0), +(425101, 193, -6387.85, -3911.94, -61.6891, NULL, 0, 1, 0, 100, 0), +(425101, 194, -6379.98, -3906.36, -61.8822, NULL, 0, 1, 0, 100, 0), +(425101, 195, -6371.86, -3902.53, -62.0803, NULL, 0, 1, 0, 100, 0), +(425101, 196, -6362.79, -3900.35, -62.2368, NULL, 0, 1, 0, 100, 0), +(425101, 197, -6352.99, -3898.99, -62.3269, NULL, 0, 1, 0, 100, 0), +(425101, 198, -6343.68, -3899.36, -62.4514, NULL, 0, 1, 0, 100, 0), +(425101, 199, -6333.33, -3900.22, -62.5877, NULL, 0, 1, 0, 100, 0), +(425101, 200, -6322.52, -3901.13, -62.8141, NULL, 0, 1, 0, 100, 0), +(425101, 201, -6311.36, -3902.06, -62.9706, NULL, 0, 1, 0, 100, 0), +(425101, 202, -6300.37, -3902.95, -63.1136, NULL, 0, 1, 0, 100, 0), +(425101, 203, -6289.89, -3903.6, -62.7118, NULL, 0, 1, 0, 100, 0), +(425101, 204, -6280.23, -3904.21, -62.3654, NULL, 0, 1, 0, 100, 0), +(425101, 205, -6270.45, -3904.84, -61.9714, NULL, 0, 1, 0, 100, 0), +(425101, 206, -6261.94, -3905.18, -61.6432, NULL, 0, 1, 0, 100, 0), +(425101, 207, -6253.55, -3905.48, -61.3237, NULL, 0, 1, 0, 100, 0), +(425101, 208, -6244.92, -3905.8, -60.9986, NULL, 0, 1, 0, 100, 0), +(425101, 209, -6236.54, -3906.1, -60.6798, NULL, 0, 1, 0, 100, 0), +(425101, 210, -6227.33, -3906.44, -60.5224, NULL, 0, 1, 0, 100, 0), +(425101, 211, -6218.47, -3906.77, -60.4412, NULL, 0, 1, 0, 100, 0), +(425101, 212, -6210.65, -3907.06, -60.3711, NULL, 0, 1, 0, 100, 0), +(425101, 213, -6199.5, -3906.93, -60.2643, NULL, 0, 1, 0, 100, 0), +(425102, 1, -6188.01, -3907.96, -60.1272, NULL, 0, 1, 0, 100, 0), +(425102, 2, -6177.6, -3906.84, -60.0201, NULL, 0, 1, 0, 100, 0), +(425102, 3, -6168.58, -3905.66, -59.9351, NULL, 0, 1, 0, 100, 0), +(425102, 4, -6157.99, -3907.73, -59.853, NULL, 0, 1, 0, 100, 0), +(425102, 5, -6148.83, -3908.73, -59.8512, NULL, 0, 1, 0, 100, 0), +(425102, 6, -6138.93, -3906.71, -59.8883, NULL, 0, 1, 0, 100, 0), +(425102, 7, -6129.07, -3906.8, -59.9096, NULL, 0, 1, 0, 100, 0), +(425102, 8, -6119.94, -3905.93, -59.9228, NULL, 0, 1, 0, 100, 0); + +-- Edit SmartAI (Goblin Racer) +UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = 4251; + +DELETE FROM `smart_scripts` WHERE (`source_type` = 0 AND `entryorguid` = 4251); +INSERT INTO `smart_scripts` (`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_param6`, `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`, `comment`) VALUES +(4251, 0, 0, 0, 108, 1, 10, 512, 0, 0, 0, 0, 0, 0, 87, 425103, 425104, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Goblin Racer - On Point Any of Path Any Reached - Run Random Script (Phase 1)'), +(4251, 0, 1, 0, 109, 1, 100, 512, 0, 425101, 0, 0, 0, 0, 80, 425102, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Goblin Racer - On Path 425101 Finished - Run Script (Phase 1)'); + +-- Edit Action List (Goblin Racer) +DELETE FROM `smart_scripts` WHERE (`source_type` = 9) AND (`entryorguid` IN (425100, 425101, 425102, 425103, 425104)); +INSERT INTO `smart_scripts` (`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_param6`, `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`, `comment`) VALUES +(425100, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 48, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Goblin Racer - Actionlist - Set Active On'), +(425100, 9, 1, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 232, 425100, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Goblin Racer - Actionlist - Start Path 425100'), +(425101, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 22, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Goblin Racer - Actionlist - Set Event Phase 1'), +(425101, 9, 1, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 232, 425101, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Goblin Racer - Actionlist - Start Path 425101'), +(425102, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 45, 1, 1, 0, 0, 0, 0, 10, 21681, 4507, 0, 0, 0, 0, 0, 0, 'Goblin Racer - Actionlist - Set Data 1 1'), +(425102, 9, 1, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 22, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Goblin Racer - Actionlist - Set Event Phase 2'), +(425102, 9, 2, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 86, 7035, 0, 10, 21681, 4507, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Goblin Racer - Actionlist - Cross Cast \'Goblin Racer Cheer\''), +(425102, 9, 3, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 232, 425102, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Goblin Racer - Actionlist - Start Path 425102'), +(425102, 9, 4, 0, 0, 0, 100, 0, 4000, 4000, 0, 0, 0, 0, 11, 60081, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Goblin Racer - Actionlist - Cast \'Cosmetic - Explosion\''), +(425102, 9, 5, 0, 0, 0, 100, 0, 1000, 1000, 0, 0, 0, 0, 41, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Goblin Racer - Actionlist - Despawn Instant'), +(425103, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 11, 6600, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Goblin Racer - Actionlist - Cast \'Salt Flats Racer Speed\''), +(425104, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 11, 6601, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Goblin Racer - Actionlist - Cast \'Salt Flats Racer Slow\''); + +-- Set Waypoint (Gnome Racer) +DELETE FROM `waypoints` WHERE (`entry` IN (425200, 425201, 425202)); + +DELETE FROM `waypoint_data` WHERE (`id` IN (425200, 425201, 425202)); +INSERT INTO `waypoint_data` (`id`, `point`, `position_x`, `position_y`, `position_z`, `orientation`, `delay`, `move_type`, `action`, `action_chance`, `wpguid`) VALUES +(425200, 1, -6213.07, -3849.85, -58.7497, NULL, 0, 0, 0, 100, 0), +(425200, 2, -6213.32, -3859.06, -58.7497, NULL, 0, 0, 0, 100, 0), +(425200, 3, -6215.83, -3866.94, -58.7497, NULL, 0, 0, 0, 100, 0), +(425200, 4, -6221.18, -3875.85, -58.7497, NULL, 0, 0, 0, 100, 0), +(425200, 5, -6230.55, -3880.74, -58.8272, NULL, 0, 0, 0, 100, 0), +(425200, 6, -6240.48, -3881.41, -59.0274, NULL, 0, 0, 0, 100, 0), +(425200, 7, -6253.07, -3881.06, -59.0491, NULL, 0, 0, 0, 100, 0), +(425200, 8, -6261.79, -3882.39, -59.2914, NULL, 0, 0, 0, 100, 0), +(425200, 9, -6268.24, -3885.55, -60.3912, NULL, 0, 0, 0, 100, 0), +(425200, 10, -6271.64, -3890.09, -61.6989, NULL, 0, 0, 0, 100, 0), +(425200, 11, -6271.71, -3895.41, -62.0288, NULL, 0, 0, 0, 100, 0), +(425200, 12, -6266.81, -3897.27, -61.8543, NULL, 0, 0, 0, 100, 0), +(425200, 13, -6256.8, -3897.43, -61.4237, NULL, 0, 0, 0, 100, 0), +(425200, 14, -6245.13, -3897.58, -61.0156, NULL, 0, 0, 0, 100, 0), +(425200, 15, -6231.72, -3897.77, -60.5649, NULL, 0, 0, 0, 100, 0), +(425200, 16, -6217.37, -3897.85, -60.4397, NULL, 0, 0, 0, 100, 0), +(425200, 17, -6207.68, -3897.86, -60.3485, NULL, 0, 0, 0, 100, 0), +(425200, 18, -6200.45, -3897.66, -60.2832, NULL, 0, 0, 0, 100, 0), +(425201, 1, -6191.13, -3897.99, -60.1547, NULL, 0, 1, 0, 100, 0), +(425201, 2, -6183.44, -3898.16, -60.0868, NULL, 0, 1, 0, 100, 0), +(425201, 3, -6174.8, -3898.45, -60.0056, NULL, 0, 1, 0, 100, 0), +(425201, 4, -6165.49, -3898.95, -59.9097, NULL, 0, 1, 0, 100, 0), +(425201, 5, -6156.97, -3899.07, -59.8555, NULL, 0, 1, 0, 100, 0), +(425201, 6, -6148.45, -3898.89, -59.8717, NULL, 0, 1, 0, 100, 0), +(425201, 7, -6140.53, -3898.68, -59.8844, NULL, 0, 1, 0, 100, 0), +(425201, 8, -6132.61, -3898.29, -59.9057, NULL, 0, 1, 0, 100, 0), +(425201, 9, -6124.03, -3897.38, -59.9139, NULL, 0, 1, 0, 100, 0), +(425201, 10, -6115.28, -3895.98, -59.949, NULL, 0, 1, 0, 100, 0), +(425201, 11, -6106.84, -3893.7, -59.9951, NULL, 0, 1, 0, 100, 0), +(425201, 12, -6098.68, -3891.24, -60.0377, NULL, 0, 1, 0, 100, 0), +(425201, 13, -6090.25, -3888.54, -60.0788, NULL, 0, 1, 0, 100, 0), +(425201, 14, -6081.56, -3885.46, -60.1355, NULL, 0, 1, 0, 100, 0), +(425201, 15, -6072.5, -3882.04, -60.1736, NULL, 0, 1, 0, 100, 0), +(425201, 16, -6064.86, -3879.16, -60.2146, NULL, 0, 1, 0, 100, 0), +(425201, 17, -6056.94, -3876.05, -60.2663, NULL, 0, 1, 0, 100, 0), +(425201, 18, -6049.15, -3872.9, -60.2967, NULL, 0, 1, 0, 100, 0), +(425201, 19, -6041.14, -3869.67, -60.3445, NULL, 0, 1, 0, 100, 0), +(425201, 20, -6032.96, -3866.25, -60.3929, NULL, 0, 1, 0, 100, 0), +(425201, 21, -6024.91, -3862.81, -60.4201, NULL, 0, 1, 0, 100, 0), +(425201, 22, -6017.94, -3859.83, -60.4674, NULL, 0, 1, 0, 100, 0), +(425201, 23, -6010.55, -3856.64, -60.5121, NULL, 0, 1, 0, 100, 0), +(425201, 24, -6002.64, -3853.19, -60.5419, NULL, 0, 1, 0, 100, 0), +(425201, 25, -5994.61, -3849.69, -60.5862, NULL, 0, 1, 0, 100, 0), +(425201, 26, -5986.62, -3846.13, -60.6333, NULL, 0, 1, 0, 100, 0), +(425201, 27, -5978.73, -3842.61, -60.6723, NULL, 0, 1, 0, 100, 0), +(425201, 28, -5970.21, -3838.81, -60.7158, NULL, 0, 1, 0, 100, 0), +(425201, 29, -5961.54, -3834.75, -60.7743, NULL, 0, 1, 0, 100, 0), +(425201, 30, -5953.2, -3828.76, -60.6922, NULL, 0, 1, 0, 100, 0), +(425201, 31, -5944.69, -3822.82, -60.4692, NULL, 0, 1, 0, 100, 0), +(425201, 32, -5936.07, -3817.66, -60.2527, NULL, 0, 1, 0, 100, 0), +(425201, 33, -5926.36, -3812.3, -60.0549, NULL, 0, 1, 0, 100, 0), +(425201, 34, -5917.03, -3807.91, -59.7889, NULL, 0, 1, 0, 100, 0), +(425201, 35, -5906.75, -3802.67, -59.591, NULL, 0, 1, 0, 100, 0), +(425201, 36, -5895.76, -3797.51, -59.7463, NULL, 0, 1, 0, 100, 0), +(425201, 37, -5886.58, -3793.77, -60.0257, NULL, 0, 1, 0, 100, 0), +(425201, 38, -5876.67, -3790.31, -60.1595, NULL, 0, 1, 0, 100, 0), +(425201, 39, -5866.79, -3786.6, -60.2363, NULL, 0, 1, 0, 100, 0), +(425201, 40, -5856.81, -3782.17, -60.7624, NULL, 0, 1, 0, 100, 0), +(425201, 41, -5847.81, -3780.26, -60.9771, NULL, 0, 1, 0, 100, 0), +(425201, 42, -5838.69, -3777.91, -61.0963, NULL, 0, 1, 0, 100, 0), +(425201, 43, -5828.99, -3776.57, -61.1453, NULL, 0, 1, 0, 100, 0), +(425201, 44, -5817.79, -3776.7, -61.2493, NULL, 0, 1, 0, 100, 0), +(425201, 45, -5808.22, -3776.95, -61.3142, NULL, 0, 1, 0, 100, 0), +(425201, 46, -5799.27, -3777.61, -61.4031, NULL, 0, 1, 0, 100, 0), +(425201, 47, -5788.73, -3778.89, -61.4787, NULL, 0, 1, 0, 100, 0), +(425201, 48, -5779.45, -3779.9, -61.5685, NULL, 0, 1, 0, 100, 0), +(425201, 49, -5770.86, -3781.42, -61.6462, NULL, 0, 1, 0, 100, 0), +(425201, 50, -5761.83, -3783.77, -61.7109, NULL, 0, 1, 0, 100, 0), +(425201, 51, -5752.74, -3785.92, -61.4701, NULL, 0, 1, 0, 100, 0), +(425201, 52, -5744.52, -3787.46, -61.3502, NULL, 0, 1, 0, 100, 0), +(425201, 53, -5735.69, -3789.1, -61.0581, NULL, 0, 1, 0, 100, 0), +(425201, 54, -5727.33, -3792.11, -60.9136, NULL, 0, 1, 0, 100, 0), +(425201, 55, -5718.91, -3797.02, -60.6031, NULL, 0, 1, 0, 100, 0), +(425201, 56, -5711.88, -3802.96, -60.9495, NULL, 0, 1, 0, 100, 0), +(425201, 57, -5704.67, -3810.75, -61.4076, NULL, 0, 1, 0, 100, 0), +(425201, 58, -5698.32, -3818.22, -61.6877, NULL, 0, 1, 0, 100, 0), +(425201, 59, -5692.7, -3825.67, -62.0049, NULL, 0, 1, 0, 100, 0), +(425201, 60, -5687.31, -3833.29, -62.2746, NULL, 0, 1, 0, 100, 0), +(425201, 61, -5683.05, -3839.84, -62.4105, NULL, 0, 1, 0, 100, 0), +(425201, 62, -5679.18, -3846.37, -62.5762, NULL, 0, 1, 0, 100, 0), +(425201, 63, -5675.19, -3854.28, -62.3824, NULL, 0, 1, 0, 100, 0), +(425201, 64, -5671.32, -3862.26, -62.2226, NULL, 0, 1, 0, 100, 0), +(425201, 65, -5667.59, -3870.17, -62.0706, NULL, 0, 1, 0, 100, 0), +(425201, 66, -5664.63, -3877.78, -61.9482, NULL, 0, 1, 0, 100, 0), +(425201, 67, -5662.53, -3886.03, -61.839, NULL, 0, 1, 0, 100, 0), +(425201, 68, -5660.7, -3894.46, -61.7547, NULL, 0, 1, 0, 100, 0), +(425201, 69, -5659.71, -3903.38, -61.622, NULL, 0, 1, 0, 100, 0), +(425201, 70, -5659, -3912.57, -61.528, NULL, 0, 1, 0, 100, 0), +(425201, 71, -5657.93, -3921.85, -61.4457, NULL, 0, 1, 0, 100, 0), +(425201, 72, -5656.73, -3930.87, -61.3267, NULL, 0, 1, 0, 100, 0), +(425201, 73, -5655.31, -3940.45, -61.2273, NULL, 0, 1, 0, 100, 0), +(425201, 74, -5653.95, -3949.8, -61.1983, NULL, 0, 1, 0, 100, 0), +(425201, 75, -5652.19, -3959.55, -61.191, NULL, 0, 1, 0, 100, 0), +(425201, 76, -5650.45, -3968.72, -61.1827, NULL, 0, 1, 0, 100, 0), +(425201, 77, -5648.88, -3977.56, -61.1758, NULL, 0, 1, 0, 100, 0), +(425201, 78, -5645.48, -3987.04, -61.1671, NULL, 0, 1, 0, 100, 0), +(425201, 79, -5643.65, -3995.95, -61.1594, NULL, 0, 1, 0, 100, 0), +(425201, 80, -5642.07, -4005.56, -61.1477, NULL, 0, 1, 0, 100, 0), +(425201, 81, -5640.9, -4015.18, -61.1393, NULL, 0, 1, 0, 100, 0), +(425201, 82, -5640.18, -4024.48, -61.1313, NULL, 0, 1, 0, 100, 0), +(425201, 83, -5639.49, -4033.56, -61.1239, NULL, 0, 1, 0, 100, 0), +(425201, 84, -5638.75, -4043.8, -61.1163, NULL, 0, 1, 0, 100, 0), +(425201, 85, -5638.62, -4052.55, -61.1497, NULL, 0, 1, 0, 100, 0), +(425201, 86, -5638.78, -4061.89, -61.2196, NULL, 0, 1, 0, 100, 0), +(425201, 87, -5640.51, -4072.33, -61.2885, NULL, 0, 1, 0, 100, 0), +(425201, 88, -5643.95, -4082.94, -61.3682, NULL, 0, 1, 0, 100, 0), +(425201, 89, -5647.96, -4091.97, -61.4318, NULL, 0, 1, 0, 100, 0), +(425201, 90, -5652.74, -4099.73, -61.4644, NULL, 0, 1, 0, 100, 0), +(425201, 91, -5658.15, -4108.15, -61.5069, NULL, 0, 1, 0, 100, 0), +(425201, 92, -5663.05, -4116.77, -61.547, NULL, 0, 1, 0, 100, 0), +(425201, 93, -5668.11, -4125.02, -61.5868, NULL, 0, 1, 0, 100, 0), +(425201, 94, -5673.62, -4133.69, -61.6279, NULL, 0, 1, 0, 100, 0), +(425201, 95, -5679.39, -4141.17, -61.5546, NULL, 0, 1, 0, 100, 0), +(425201, 96, -5685.81, -4147.76, -61.2686, NULL, 0, 1, 0, 100, 0), +(425201, 97, -5693.73, -4153.52, -60.805, NULL, 0, 1, 0, 100, 0), +(425201, 98, -5702.2, -4158.68, -60.38, NULL, 0, 1, 0, 100, 0), +(425201, 99, -5711.17, -4163.68, -60.5767, NULL, 0, 1, 0, 100, 0), +(425201, 100, -5719.97, -4167.7, -60.7495, NULL, 0, 1, 0, 100, 0), +(425201, 101, -5728.91, -4171.09, -60.9849, NULL, 0, 1, 0, 100, 0), +(425201, 102, -5738.42, -4174.28, -61.3725, NULL, 0, 1, 0, 100, 0), +(425201, 103, -5747.66, -4176.74, -61.4211, NULL, 0, 1, 0, 100, 0), +(425201, 104, -5757.03, -4179.17, -61.4857, NULL, 0, 1, 0, 100, 0), +(425201, 105, -5766.08, -4181.43, -61.5319, NULL, 0, 1, 0, 100, 0), +(425201, 106, -5775.63, -4183.64, -61.523, NULL, 0, 1, 0, 100, 0), +(425201, 107, -5785.16, -4185.34, -61.3824, NULL, 0, 1, 0, 100, 0), +(425201, 108, -5794.63, -4186.67, -61.2606, NULL, 0, 1, 0, 100, 0), +(425201, 109, -5804.93, -4187.97, -61.3876, NULL, 0, 1, 0, 100, 0), +(425201, 110, -5814.68, -4188.93, -61.6206, NULL, 0, 1, 0, 100, 0), +(425201, 111, -5824.68, -4189.75, -61.8774, NULL, 0, 1, 0, 100, 0), +(425201, 112, -5833.86, -4190.43, -62.1073, NULL, 0, 1, 0, 100, 0), +(425201, 113, -5842.48, -4191, -62.3082, NULL, 0, 1, 0, 100, 0), +(425201, 114, -5851.21, -4191.57, -62.5253, NULL, 0, 1, 0, 100, 0), +(425201, 115, -5861.32, -4192.4, -62.6363, NULL, 0, 1, 0, 100, 0), +(425201, 116, -5871.21, -4193.24, -62.6999, NULL, 0, 1, 0, 100, 0), +(425201, 117, -5880.64, -4193.85, -62.7766, NULL, 0, 1, 0, 100, 0), +(425201, 118, -5889.84, -4194.21, -62.8327, NULL, 0, 1, 0, 100, 0), +(425201, 119, -5898.47, -4194.51, -62.8894, NULL, 0, 1, 0, 100, 0), +(425201, 120, -5907.67, -4194.83, -62.8819, NULL, 0, 1, 0, 100, 0), +(425201, 121, -5916.77, -4195.14, -62.7659, NULL, 0, 1, 0, 100, 0), +(425201, 122, -5926.44, -4195.48, -62.6792, NULL, 0, 1, 0, 100, 0), +(425201, 123, -5936.36, -4195.62, -62.5624, NULL, 0, 1, 0, 100, 0), +(425201, 124, -5945.7, -4195.7, -62.4532, NULL, 0, 1, 0, 100, 0), +(425201, 125, -5955.38, -4195.71, -62.3407, NULL, 0, 1, 0, 100, 0), +(425201, 126, -5965.41, -4195.57, -62.2259, NULL, 0, 1, 0, 100, 0), +(425201, 127, -5975.91, -4195.54, -62.2551, NULL, 0, 1, 0, 100, 0), +(425201, 128, -5986.3, -4195.46, -62.3111, NULL, 0, 1, 0, 100, 0), +(425201, 129, -5996.9, -4195.03, -62.3646, NULL, 0, 1, 0, 100, 0), +(425201, 130, -6006.44, -4194.28, -62.4284, NULL, 0, 1, 0, 100, 0), +(425201, 131, -6015.97, -4193.45, -62.4367, NULL, 0, 1, 0, 100, 0), +(425201, 132, -6025.38, -4192.59, -62.5398, NULL, 0, 1, 0, 100, 0), +(425201, 133, -6034.45, -4191.69, -62.5892, NULL, 0, 1, 0, 100, 0), +(425201, 134, -6043.49, -4190.67, -62.6533, NULL, 0, 1, 0, 100, 0), +(425201, 135, -6053.09, -4189.39, -62.6578, NULL, 0, 1, 0, 100, 0), +(425201, 136, -6063.16, -4188.11, -62.4733, NULL, 0, 1, 0, 100, 0), +(425201, 137, -6072.55, -4187.03, -62.2856, NULL, 0, 1, 0, 100, 0), +(425201, 138, -6082.19, -4186.11, -62.0776, NULL, 0, 1, 0, 100, 0), +(425201, 139, -6092.67, -4185.46, -62.051, NULL, 0, 1, 0, 100, 0), +(425201, 140, -6103.04, -4184.89, -62.2653, NULL, 0, 1, 0, 100, 0), +(425201, 141, -6113.42, -4184.63, -62.4858, NULL, 0, 1, 0, 100, 0), +(425201, 142, -6124.15, -4184.92, -62.6071, NULL, 0, 1, 0, 100, 0), +(425201, 143, -6134.52, -4185.2, -62.3842, NULL, 0, 1, 0, 100, 0), +(425201, 144, -6145.36, -4185.69, -62.1294, NULL, 0, 1, 0, 100, 0), +(425201, 145, -6155.71, -4186.58, -61.9095, NULL, 0, 1, 0, 100, 0), +(425201, 146, -6166.17, -4187.48, -61.7304, NULL, 0, 1, 0, 100, 0), +(425201, 147, -6177.33, -4188.44, -61.696, NULL, 0, 1, 0, 100, 0), +(425201, 148, -6185.81, -4189.2, -61.6767, NULL, 0, 1, 0, 100, 0), +(425201, 149, -6195.39, -4190.63, -61.6506, NULL, 0, 1, 0, 100, 0), +(425201, 150, -6205.03, -4192.38, -61.6175, NULL, 0, 1, 0, 100, 0), +(425201, 151, -6214.78, -4194.21, -61.5961, NULL, 0, 1, 0, 100, 0), +(425201, 152, -6224.48, -4196.3, -61.6135, NULL, 0, 1, 0, 100, 0), +(425201, 153, -6233.62, -4198.14, -61.6568, NULL, 0, 1, 0, 100, 0), +(425201, 154, -6242.89, -4199.97, -61.6911, NULL, 0, 1, 0, 100, 0), +(425201, 155, -6252.97, -4201.97, -61.7273, NULL, 0, 1, 0, 100, 0), +(425201, 156, -6262.82, -4203.9, -61.6297, NULL, 0, 1, 0, 100, 0), +(425201, 157, -6273.05, -4205.66, -61.5693, NULL, 0, 1, 0, 100, 0), +(425201, 158, -6282.99, -4206.99, -61.4881, NULL, 0, 1, 0, 100, 0), +(425201, 159, -6294.46, -4208.37, -61.3831, NULL, 0, 1, 0, 100, 0), +(425201, 160, -6304.92, -4209.25, -61.3155, NULL, 0, 1, 0, 100, 0), +(425201, 161, -6316.44, -4210.08, -61.9332, NULL, 0, 1, 0, 100, 0), +(425201, 162, -6328.2, -4210.85, -62.4794, NULL, 0, 1, 0, 100, 0), +(425201, 163, -6338.91, -4211.56, -62.6251, NULL, 0, 1, 0, 100, 0), +(425201, 164, -6348.49, -4210.64, -62.0232, NULL, 0, 1, 0, 100, 0), +(425201, 165, -6356.92, -4207.3, -61.6654, NULL, 0, 1, 0, 100, 0), +(425201, 166, -6364.13, -4202.14, -61.1157, NULL, 0, 1, 0, 100, 0), +(425201, 167, -6371.33, -4196.2, -61.4884, NULL, 0, 1, 0, 100, 0), +(425201, 168, -6378.78, -4189.83, -61.7792, NULL, 0, 1, 0, 100, 0), +(425201, 169, -6385.96, -4183.68, -62.2433, NULL, 0, 1, 0, 100, 0), +(425201, 170, -6393.2, -4176.92, -62.6041, NULL, 0, 1, 0, 100, 0), +(425201, 171, -6399.35, -4170.36, -62.9947, NULL, 0, 1, 0, 100, 0), +(425201, 172, -6404.76, -4162.21, -63.22, NULL, 0, 1, 0, 100, 0), +(425201, 173, -6409.01, -4154.56, -63.3792, NULL, 0, 1, 0, 100, 0), +(425201, 174, -6412.76, -4146.4, -63.5873, NULL, 0, 1, 0, 100, 0), +(425201, 175, -6416.19, -4138.1, -63.8013, NULL, 0, 1, 0, 100, 0), +(425201, 176, -6419.27, -4129.67, -64.0044, NULL, 0, 1, 0, 100, 0), +(425201, 177, -6421.97, -4120.87, -64.0823, NULL, 0, 1, 0, 100, 0), +(425201, 178, -6424.7, -4111.7, -63.9544, NULL, 0, 1, 0, 100, 0), +(425201, 179, -6427.14, -4102.09, -63.8454, NULL, 0, 1, 0, 100, 0), +(425201, 180, -6429.14, -4092.39, -63.739, NULL, 0, 1, 0, 100, 0), +(425201, 181, -6430.8, -4082.72, -63.6193, NULL, 0, 1, 0, 100, 0), +(425201, 182, -6431.55, -4072.96, -63.5013, NULL, 0, 1, 0, 100, 0), +(425201, 183, -6431.81, -4063.41, -63.4091, NULL, 0, 1, 0, 100, 0), +(425201, 184, -6432.07, -4053.72, -63.3199, NULL, 0, 1, 0, 100, 0), +(425201, 185, -6432.12, -4044.15, -63.2197, NULL, 0, 1, 0, 100, 0), +(425201, 186, -6432.02, -4034.24, -63.1279, NULL, 0, 1, 0, 100, 0), +(425201, 187, -6431.8, -4023.63, -63.0207, NULL, 0, 1, 0, 100, 0), +(425201, 188, -6431.49, -4013.71, -62.927, NULL, 0, 1, 0, 100, 0), +(425201, 189, -6431.01, -4004.51, -62.8465, NULL, 0, 1, 0, 100, 0), +(425201, 190, -6429.68, -3994.92, -62.8435, NULL, 0, 1, 0, 100, 0), +(425201, 191, -6428, -3984.32, -62.8388, NULL, 0, 1, 0, 100, 0), +(425201, 192, -6425.7, -3974.44, -62.8355, NULL, 0, 1, 0, 100, 0), +(425201, 193, -6423.12, -3964.14, -62.8313, NULL, 0, 1, 0, 100, 0), +(425201, 194, -6420.24, -3954.9, -62.8263, NULL, 0, 1, 0, 100, 0), +(425201, 195, -6416.66, -3945.65, -62.6458, NULL, 0, 1, 0, 100, 0), +(425201, 196, -6412.34, -3937.4, -62.5412, NULL, 0, 1, 0, 100, 0), +(425201, 197, -6406.42, -3928.75, -62.1537, NULL, 0, 1, 0, 100, 0), +(425201, 198, -6398.58, -3922.15, -61.7519, NULL, 0, 1, 0, 100, 0), +(425201, 199, -6389.51, -3916.89, -61.5696, NULL, 0, 1, 0, 100, 0), +(425201, 200, -6380.43, -3912.63, -61.7523, NULL, 0, 1, 0, 100, 0), +(425201, 201, -6370.58, -3909.01, -61.9721, NULL, 0, 1, 0, 100, 0), +(425201, 202, -6360.86, -3906.08, -62.2233, NULL, 0, 1, 0, 100, 0), +(425201, 203, -6351.73, -3903.65, -62.3375, NULL, 0, 1, 0, 100, 0), +(425201, 204, -6342.71, -3901.26, -62.4708, NULL, 0, 1, 0, 100, 0), +(425201, 205, -6333.07, -3898.94, -62.5955, NULL, 0, 1, 0, 100, 0), +(425201, 206, -6322.43, -3897.58, -62.822, NULL, 0, 1, 0, 100, 0), +(425201, 207, -6312.65, -3897.02, -62.939, NULL, 0, 1, 0, 100, 0), +(425201, 208, -6302.74, -3896.83, -63.0881, NULL, 0, 1, 0, 100, 0), +(425201, 209, -6293.4, -3896.73, -62.8319, NULL, 0, 1, 0, 100, 0), +(425201, 210, -6283.84, -3896.64, -62.4841, NULL, 0, 1, 0, 100, 0), +(425201, 211, -6274.15, -3896.57, -62.109, NULL, 0, 1, 0, 100, 0), +(425201, 212, -6263.76, -3896.5, -61.7205, NULL, 0, 1, 0, 100, 0), +(425201, 213, -6253.84, -3896.48, -61.3577, NULL, 0, 1, 0, 100, 0), +(425201, 214, -6243.23, -3896.49, -60.9442, NULL, 0, 1, 0, 100, 0), +(425201, 215, -6233.32, -3896.47, -60.5944, NULL, 0, 1, 0, 100, 0), +(425201, 216, -6222.59, -3896.66, -60.4868, NULL, 0, 1, 0, 100, 0), +(425201, 217, -6213.38, -3896.88, -60.3687, NULL, 0, 1, 0, 100, 0), +(425201, 218, -6200.45, -3897.66, -60.2832, NULL, 0, 1, 0, 100, 0), +(425202, 1, -6190.65, -3896.22, -60.1529, NULL, 0, 1, 0, 100, 0), +(425202, 2, -6180.66, -3896.07, -60.0595, NULL, 0, 1, 0, 100, 0), +(425202, 3, -6171.55, -3897.96, -59.9696, NULL, 0, 1, 0, 100, 0), +(425202, 4, -6161.52, -3896.79, -59.8741, NULL, 0, 1, 0, 100, 0), +(425202, 5, -6151.06, -3897.01, -59.8661, NULL, 0, 1, 0, 100, 0), +(425202, 6, -6141.54, -3898.68, -59.8809, NULL, 0, 1, 0, 100, 0), +(425202, 7, -6132.44, -3897.03, -59.9045, NULL, 0, 1, 0, 100, 0), +(425202, 8, -6117.72, -3893.62, -59.9211, NULL, 0, 1, 0, 100, 0); + +-- Edit SmartAI (Gnome Racer) +UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = 4252; + +DELETE FROM `smart_scripts` WHERE (`source_type` = 0 AND `entryorguid` = 4252); +INSERT INTO `smart_scripts` (`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_param6`, `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`, `comment`) VALUES +(4252, 0, 0, 0, 40, 1, 10, 512, 0, 0, 0, 0, 0, 0, 87, 425203, 425204, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Gnome Racer - On Point Any of Path Any Reached - Run Random Script (Phase 1)'), +(4252, 0, 1, 0, 109, 1, 100, 512, 0, 425201, 0, 0, 0, 0, 80, 425202, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Gnome Racer - On Path 425201 Finished - Run Script (Phase 1)'); + +-- Edit Action Lists (Gnome Racer) +DELETE FROM `smart_scripts` WHERE (`source_type` = 9) AND (`entryorguid` IN (425200, 425201, 425202, 425203, 425204)); +INSERT INTO `smart_scripts` (`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_param6`, `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`, `comment`) VALUES +(425200, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 48, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Gnome Racer - Actionlist - Set Active On'), +(425200, 9, 1, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 232, 425200, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Gnome Racer - Actionlist - Start Path 425200'), +(425201, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 22, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Gnome Racer - Actionlist - Set Event Phase 1'), +(425201, 9, 1, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 232, 425201, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Gnome Racer - Actionlist - Start Path 425201'), +(425202, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 45, 1, 2, 0, 0, 0, 0, 10, 21681, 4507, 0, 0, 0, 0, 0, 0, 'Gnome Racer - Actionlist - Set Data 1 2'), +(425202, 9, 1, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 22, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Gnome Racer - Actionlist - Set Event Phase 2'), +(425202, 9, 2, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 86, 7036, 0, 10, 21681, 4507, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Gnome Racer - Actionlist - Cross Cast \'Gnome Racer Cheer\''), +(425202, 9, 3, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 232, 425202, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Gnome Racer - Actionlist - Start Path 425202'), +(425202, 9, 4, 0, 0, 0, 100, 0, 4000, 4000, 0, 0, 0, 0, 11, 60081, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Gnome Racer - Actionlist - Cast \'Cosmetic - Explosion\''), +(425202, 9, 5, 0, 0, 0, 100, 0, 1000, 1000, 0, 0, 0, 0, 41, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Gnome Racer - Actionlist - Despawn Instant'), +(425203, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 11, 6600, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Gnome Racer - Actionlist - Cast \'Salt Flats Racer Speed\''), +(425204, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 11, 6601, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Gnome Racer - Actionlist - Cast \'Salt Flats Racer Slow\''); + +-- Set Waypoint (Daisy) +DELETE FROM `waypoints` WHERE (`entry` IN (450700)); + +DELETE FROM `waypoint_data` WHERE (`id` IN (450700)); +INSERT INTO `waypoint_data` (`id`, `point`, `position_x`, `position_y`, `position_z`, `orientation`, `delay`, `move_type`, `action`, `action_chance`, `wpguid`) VALUES +(450700, 1, -6181.54, -3901.89, -60.0522, NULL, 0, 0, 0, 100, 0), +(450700, 2, -6181.91, -3906.66, -60.0592, NULL, 0, 0, 0, 100, 0), +(450700, 3, -6182.58, -3912.22, -59.9758, NULL, 0, 0, 0, 100, 0), +(450700, 4, -6182.4, -3917.94, -58.8287, NULL, 0, 0, 0, 100, 0); + +-- Edit SmartAI (Daisy) +UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = 4507; + +DELETE FROM `smart_scripts` WHERE (`source_type` = 0 AND `entryorguid` = 4507); +INSERT INTO `smart_scripts` (`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_param6`, `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`, `comment`) VALUES +(4507, 0, 0, 0, 11, 0, 100, 512, 0, 0, 0, 0, 0, 0, 80, 450700, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Daisy - On Respawn - Run Script'), +(4507, 0, 1, 0, 38, 1, 100, 513, 1, 1, 0, 0, 0, 0, 22, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Daisy - On Data Set 1 1 - Set Event Phase 2 (Phase 1) (No Repeat)'), +(4507, 0, 2, 0, 38, 1, 100, 513, 1, 2, 0, 0, 0, 0, 22, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Daisy - On Data Set 1 2 - Set Event Phase 2 (Phase 1) (No Repeat)'), +(4507, 0, 3, 0, 66, 0, 100, 512, 2, 0, 0, 0, 0, 0, 80, 450701, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Daisy - On Event Phase 2 Set - Run Script'); + +-- Esit Action List (Daisy) +DELETE FROM `smart_scripts` WHERE (`source_type` = 9) AND (`entryorguid` IN (450700, 450701)); +INSERT INTO `smart_scripts` (`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_param6`, `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`, `comment`) VALUES +(450700, 9, 0, 0, 0, 0, 100, 0, 30000, 90000, 0, 0, 0, 0, 48, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Daisy - Actionlist - Set Active On'), +(450700, 9, 1, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 80, 425100, 2, 0, 0, 0, 0, 10, 21680, 4251, 0, 0, 0, 0, 0, 0, 'Daisy - Actionlist - Run Script'), +(450700, 9, 2, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 80, 425200, 2, 0, 0, 0, 0, 10, 21682, 4252, 0, 0, 0, 0, 0, 0, 'Daisy - Actionlist - Run Script'), +(450700, 9, 3, 0, 0, 0, 100, 0, 10000, 10000, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 10, 21549, 4419, 0, 0, 0, 0, 0, 0, 'Daisy - Actionlist - Say Line 0'), +(450700, 9, 4, 0, 0, 0, 100, 0, 30000, 30000, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 10, 21145, 4620, 0, 0, 0, 0, 0, 0, 'Daisy - Actionlist - Say Line 0'), +(450700, 9, 5, 0, 0, 0, 100, 0, 30000, 30000, 0, 0, 0, 0, 5, 36, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Daisy - Actionlist - Play Emote 36'), +(450700, 9, 6, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 10, 21145, 4620, 0, 0, 0, 0, 0, 0, 'Daisy - Actionlist - Say Line 1'), +(450700, 9, 7, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 80, 425101, 2, 0, 0, 0, 0, 10, 21680, 4251, 0, 0, 0, 0, 0, 0, 'Daisy - Actionlist - Run Script'), +(450700, 9, 8, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 80, 425201, 2, 0, 0, 0, 0, 10, 21682, 4252, 0, 0, 0, 0, 0, 0, 'Daisy - Actionlist - Run Script'), +(450700, 9, 9, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 22, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Daisy - Actionlist - Set Event Phase 1'), +(450701, 9, 0, 0, 0, 0, 100, 0, 30000, 30000, 0, 0, 0, 0, 232, 450700, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Daisy - Actionlist - Start Path 450700'), +(450701, 9, 1, 0, 0, 0, 100, 0, 8000, 8000, 0, 0, 0, 0, 66, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 1.60989, 'Daisy - Actionlist - Set Orientation 1.60989'), +(450701, 9, 2, 0, 0, 0, 100, 0, 600000, 600000, 0, 0, 0, 0, 41, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Daisy - Actionlist - Despawn Instant'); From 2bec42c747e19136a16b9520cc79d9893cb4cfb5 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 28 Oct 2025 13:33:14 +0000 Subject: [PATCH 25/28] chore(DB): import pending files Referenced commit(s): b74dc4961ccb5add21bbf6d96f3a49bb9787a6e6 --- .../Thousand_needles_racing.sql => db_world/2025_10_28_04.sql} | 1 + 1 file changed, 1 insertion(+) rename data/sql/updates/{pending_db_world/Thousand_needles_racing.sql => db_world/2025_10_28_04.sql} (99%) diff --git a/data/sql/updates/pending_db_world/Thousand_needles_racing.sql b/data/sql/updates/db_world/2025_10_28_04.sql similarity index 99% rename from data/sql/updates/pending_db_world/Thousand_needles_racing.sql rename to data/sql/updates/db_world/2025_10_28_04.sql index 1b0f677b7..82fd9d025 100644 --- a/data/sql/updates/pending_db_world/Thousand_needles_racing.sql +++ b/data/sql/updates/db_world/2025_10_28_04.sql @@ -1,3 +1,4 @@ +-- DB update 2025_10_28_03 -> 2025_10_28_04 -- Set Waypoint (Goblin Racer) DELETE FROM `waypoints` WHERE (`entry` IN (425100, 425101, 425102)); From 4fd7a2a644b86e557dd7c9722cbbb3fbca208e5a Mon Sep 17 00:00:00 2001 From: killerwife Date: Tue, 28 Oct 2025 18:56:44 +0100 Subject: [PATCH 26/28] Waypoint: Fix last point not being reached on non 0 indexed paths (#23460) --- .../WaypointMovementGenerator.cpp | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp index e2eb0aab7..a894c8d06 100644 --- a/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp @@ -130,8 +130,6 @@ bool WaypointMovementGenerator::StartMove(Creature* creature) if (m_isArrivalDone) { - // Xinef: not true... update this at every waypoint! - //if ((i_currentNode == i_path->size() - 1) && !repeating) // If that's our last waypoint { auto currentNodeItr = i_path->find(i_currentNode); float x = currentNodeItr->second.x; @@ -157,7 +155,8 @@ bool WaypointMovementGenerator::StartMove(Creature* creature) } // Xinef: moved the upper IF here - if ((i_currentNode == i_path->size() - 1) && !repeating) // If that's our last waypoint + uint32 lastPoint = i_path->rbegin()->first; + if ((i_currentNode == lastPoint) && !repeating) // If that's our last waypoint { creature->AI()->PathEndReached(path_id); creature->GetMotionMaster()->Initialize(); @@ -165,7 +164,7 @@ bool WaypointMovementGenerator::StartMove(Creature* creature) } ++i_currentNode; - if (i_path->rbegin()->first < i_currentNode) + if (lastPoint < i_currentNode) i_currentNode = i_path->begin()->first; } @@ -260,13 +259,7 @@ bool WaypointMovementGenerator::DoUpdate(Creature* creature, uint32 di } else { - bool finished = creature->movespline->Finalized(); - // xinef: code to detect pre-empetively if we should start movement to next waypoint - // xinef: do not start pre-empetive movement if current node has delay or we are ending waypoint movement - //if (!finished && !i_path->at(i_currentNode)->delay && ((i_currentNode != i_path->size() - 1) || repeating)) - // finished = (creature->movespline->_Spline().length(creature->movespline->_currentSplineIdx() + 1) - creature->movespline->timePassed()) < 200; - - if (finished) + if (creature->movespline->Finalized()) { OnArrived(creature); return StartMove(creature); From f0ba3ac82143c6501275c59474d285827261b8e3 Mon Sep 17 00:00:00 2001 From: blinkysc <37940565+blinkysc@users.noreply.github.com> Date: Tue, 28 Oct 2025 18:41:38 -0500 Subject: [PATCH 27/28] fix(SAI/HoS) Multiple changes to Unrelenting Construct SmartAI (#23407) Co-authored-by: John Doe --- .../pending_db_world/rev_1761412847523099794.sql | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 data/sql/updates/pending_db_world/rev_1761412847523099794.sql diff --git a/data/sql/updates/pending_db_world/rev_1761412847523099794.sql b/data/sql/updates/pending_db_world/rev_1761412847523099794.sql new file mode 100644 index 000000000..ed8b7ecbb --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1761412847523099794.sql @@ -0,0 +1,12 @@ +-- +UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = 27971; +DELETE FROM `smart_scripts` WHERE (`source_type` = 0 AND `entryorguid` = 27971); +INSERT INTO `smart_scripts` (`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_param6`, `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`, `comment`) VALUES +(27971, 0, 0, 0, 0, 0, 100, 2, 12000, 18000, 12000, 18000, 0, 0, 11, 51842, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 'Unrelenting Construct - In Combat - Cast \'Charge\' (No Repeat) (Dungeon/Normal)'), +(27971, 0, 1, 0, 0, 0, 100, 4, 12000, 18000, 12000, 18000, 0, 0, 11, 59040, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 'Unrelenting Construct - In Combat - Cast \'Charge\' (No Repeat) (Dungeon/Heroic)'), +(27971, 0, 2, 0, 0, 0, 100, 2, 4000, 7000, 9000, 16000, 0, 0, 11, 51491, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Unrelenting Construct - In Combat - Cast \'Unrelenting Strike\' (No Repeat) (Dungeon/Normal)'), +(27971, 0, 3, 0, 0, 0, 100, 4, 4000, 7000, 9000, 16000, 0, 0, 11, 59039, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Unrelenting Construct - In Combat - Cast \'Unrelenting Strike\' (No Repeat) (Dungeon/Heroic)'), +(27971, 0, 4, 6, 2, 0, 100, 515, 0, 25, 0, 0, 0, 0, 11, 51832, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Unrelenting Construct - Between 0-25% Health - Cast \'Short Circuit\' (No Repeat) (Dungeon)'), +(27971, 0, 5, 6, 2, 0, 100, 517, 0, 25, 0, 0, 0, 0, 11, 61513, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Unrelenting Construct - Between 0-25% Health - Cast \'Short Circuit\' (No Repeat) (Dungeon)'), +(27971, 0, 6, 7, 61, 0, 100, 0, 0, 0, 0, 0, 0, 0, 37, 3500, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Unrelenting Construct - Die from \'Short Circuit\' (Dungeon)'), +(27971, 0, 7, 0, 61, 0, 100, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Unrelenting Construct - Set State Passive while waiting death (Dungeon)'); From cbec99efb3d1c0d2c5a9428b0ae5641fc4ff54c0 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 28 Oct 2025 23:42:44 +0000 Subject: [PATCH 28/28] chore(DB): import pending files Referenced commit(s): f0ba3ac82143c6501275c59474d285827261b8e3 --- .../rev_1761412847523099794.sql => db_world/2025_10_28_05.sql} | 1 + 1 file changed, 1 insertion(+) rename data/sql/updates/{pending_db_world/rev_1761412847523099794.sql => db_world/2025_10_28_05.sql} (98%) diff --git a/data/sql/updates/pending_db_world/rev_1761412847523099794.sql b/data/sql/updates/db_world/2025_10_28_05.sql similarity index 98% rename from data/sql/updates/pending_db_world/rev_1761412847523099794.sql rename to data/sql/updates/db_world/2025_10_28_05.sql index ed8b7ecbb..a843dd705 100644 --- a/data/sql/updates/pending_db_world/rev_1761412847523099794.sql +++ b/data/sql/updates/db_world/2025_10_28_05.sql @@ -1,3 +1,4 @@ +-- DB update 2025_10_28_04 -> 2025_10_28_05 -- UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = 27971; DELETE FROM `smart_scripts` WHERE (`source_type` = 0 AND `entryorguid` = 27971);