Skip to content

fix(Core/SmartAI): Mist escort and follow completion granting Credit#25653

Open
sogladev wants to merge 2 commits intoazerothcore:masterfrom
sogladev:fix-smartai-action-follow-credit
Open

fix(Core/SmartAI): Mist escort and follow completion granting Credit#25653
sogladev wants to merge 2 commits intoazerothcore:masterfrom
sogladev:fix-smartai-action-follow-credit

Conversation

@sogladev
Copy link
Copy Markdown
Member

Changes Proposed:

This PR proposes changes to:

  • Core (units, players, creatures, game systems).
  • Scripts (bosses, spell scripts, creature scripts).
  • Database (SAI, creatures, etc).

Refactor Mist SmartAI, and use Credit set by the follow action to complete the quest.

The Credit handling broke in a refactor some time ago pre-AC:
TrinityCore/TrinityCore@b0ae5fa

The following SmartAI actions are affected:

action_type = 29 and action_param3 > 0

entryorguid action_param3 comment
3568 3519 Mist - On Quest 'Mist' Taken - Start Follow Invoker
10290 1 Captured Felwood Ooze - On Just Summoned - Start Follow Closest Primal Ooze
23689 24170 Proto-Drake - Out of Combat - Start Follow Closest Creature 'Draconis Gastritis Bunny'
30886 30232 Subjugated Iskalder - On Just Summoned - Start Follow Invoker
777400 7765 Shay Leafrunner - Actionlist - Start Follow Invoker
777401 7765 Shay Leafrunner - Actionlist - Start Follow Invoker
2547400 25262 Captured Beryl Sorcerer - Actionlist - Start Follow Owner Or Summoner

So far I just tested Mist

AI-assisted Pull Requests

Important

While the use of AI tools when preparing pull requests is not prohibited, contributors must clearly disclose when such tools have been used and specify the model involved.

Contributors are also expected to fully understand the changes they are submitting and must be able to explain and justify those changes when requested by maintainers.

  • AI tools (e.g. ChatGPT, Claude, or similar) were used entirely or partially in preparing this pull request. Please specify which tools were used, if any.

Issues Addressed:

SOURCE:

The changes have been validated through:

  • Live research (checked on live servers, e.g Classic WotLK, Retail, etc.)
  • Sniffs (remember to share them with the open source community!)
  • Video evidence, knowledge databases or other public sources (e.g forums, Wowhead, etc.)
  • The changes promoted by this pull request come partially or entirely from another project (cherry-pick). Cherry-picks must be committed using the proper --author tag in order to be accepted, thus crediting the original authors, unless otherwise unable to be found

Tests Performed:

This PR has been:

  • Tested in-game by the author.
  • Tested in-game by other community members/someone else other than the author/has been live on production servers.
  • This pull request requires further testing and may have edge cases to be tested.

How to Test the Changes:

  • This pull request can be tested by following the reproduction steps provided in the linked issue
  • This pull request requires further testing. Provide steps to test your changes. If it requires any specific setup e.g multiple players please specify it as well.

Known Issues and TODO List:

  • [ ]
  • [ ]

How to Test AzerothCore PRs

When a PR is ready to be tested, it will be marked as [WAITING TO BE TESTED].

You can help by testing PRs and writing your feedback here on the PR's page on GitHub. Follow the instructions here:

http://www.azerothcore.org/wiki/How-to-test-a-PR

REMEMBER: when testing a PR that changes something generic (i.e. a part of code that handles more than one specific thing), the tester should not only check that the PR does its job (e.g. fixing spell XXX) but especially check that the PR does not cause any regression (i.e. introducing new bugs).

For example: if a PR fixes spell X by changing a part of code that handles spells X, Y, and Z, we should not only test X, but we should test Y and Z as well.

Copilot AI review requested due to automatic review settings April 29, 2026 16:09
@github-actions github-actions Bot added DB related to the SQL database CORE Related to the core file-cpp Used to trigger the matrix build labels Apr 29, 2026
@sogladev sogladev force-pushed the fix-smartai-action-follow-credit branch from 699fb08 to a7693c3 Compare April 29, 2026 16:10
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes SmartAI follow completion credit handling so escort/follow quests (starting with “Mist”) can complete via the credit configured on SMART_ACTION_FOLLOW, and updates Mist’s SAI to use follow completion credit to reset correctly.

Changes:

  • Move follow completion credit-granting logic in SmartAI::StopFollow() to run before the follow state is cleared.
  • Update Mist (entry 3568) SmartAI to grant quest credit via follow completion credit (instead of distance checks) and ensure it resets/despawns properly.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/server/game/AI/SmartScripts/SmartAI.cpp Adjusts follow-stop logic so follow completion credit can be granted reliably.
data/sql/updates/pending_db_world/rev_1777475353267081450.sql Refactors Mist’s smart_scripts to use follow credit + follow completion for quest completion/reset.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/server/game/AI/SmartScripts/SmartAI.cpp Outdated
Comment on lines +8 to +9
(3568, 0, 5, 0, 6, 0, 100, 512, 0, 0, 0, 0, 0, 0, 70, 1000, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Mist - On Just Died - Respawn Self'),
(3568, 0, 6, 7, 11, 0, 100, 512, 0, 0, 0, 0, 0, 0, 18, 512, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Mist - On Respawn - Set Flags Immune To NPC\'s'),
@PkllonG
Copy link
Copy Markdown
Contributor

PkllonG commented May 3, 2026

I tested (3568, 30886, 777400, 777401)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CORE Related to the core DB related to the SQL database file-cpp Used to trigger the matrix build Ready to be Reviewed Waiting to be Tested

Projects

None yet

Development

Successfully merging this pull request may close these issues.

NPC will continue to follow the player even after the “Mist” quest has been turned in

4 participants