fix(Core/Scripts): Move EasternKingdoms gossip to database#25208
fix(Core/Scripts): Move EasternKingdoms gossip to database#25208Nyeriah wants to merge 1 commit intoazerothcore:masterfrom
Conversation
Move gossip handling from C++ to database-driven gossip with conditions and SmartAI for Augustus the Touched, Parqual Fintallas, and Lokhtos Darkbargainer. Closes #0 Co-Authored-By: offl <offl@users.noreply.github.com> Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Migrates gossip handling for three Eastern Kingdoms NPCs from C++ scripts to database-driven gossip using conditions and SmartAI.
Changes:
- Removed C++ gossip scripts/registrations for Augustus the Touched, Parqual Fintallas, and Lokhtos Darkbargainer.
- Added pending world DB update to drive gossip text switching, option visibility, and gossip-select actions via Conditions + SmartAI.
- Set
AIName='SmartAI'for Parqual and Lokhtos to support gossip-select action scripting.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| src/server/scripts/EasternKingdoms/zone_undercity.cpp | Removes Parqual Fintallas C++ gossip script and registration. |
| src/server/scripts/EasternKingdoms/zone_eastern_plaguelands.cpp | Removes Augustus the Touched C++ gossip script and registration. |
| src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/blackrock_depths.cpp | Removes Lokhtos Darkbargainer C++ AI/gossip script and registration. |
| data/sql/updates/pending_db_world/rev_1774395836122258800.sql | Adds DB-driven gossip/SAI logic for the three NPCs. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| -- Condition: show text 3677 only if rep >= Friendly with Thorium Brotherhood (faction 59) | ||
| -- Text 3673 has no condition and serves as the default (unfriendly) text | ||
| -- Friendly(4)=16, Honored(5)=32, Revered(6)=64, Exalted(7)=128 => mask 240 | ||
| DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` = 14 AND `SourceGroup` = 4781; | ||
| INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES | ||
| (14, 4781, 3677, 0, 0, 5, 0, 59, 240, 0, 0, 0, 0, '', 'Lokhtos Darkbargainer - Show text 3677 if Thorium Brotherhood rep >= Friendly'); |
There was a problem hiding this comment.
With 3673 left unconditional, Friendly+ players will satisfy both texts (3673 and 3677). For gossip_menu, multiple valid texts for the same MenuID can result in non-deterministic/random selection, so Friendly+ players may still see the unfriendly text. Add a complementary condition to 3673 (rep < Friendly) or otherwise ensure only one text is valid at a time (e.g., by conditioning both texts or using mutually exclusive ElseGroups).
| -- Condition: show vendor option (MenuID 4085, OptionID 0) only if quest 6164 rewarded | ||
| DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` = 15 AND `SourceGroup` = 4085 AND `SourceEntry` = 0; | ||
| INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES | ||
| (15, 4085, 0, 0, 0, 8, 0, 6164, 0, 0, 0, 0, 0, '', 'Augustus the Touched - Show vendor option only if quest 6164 rewarded'); |
There was a problem hiding this comment.
The C++ script previously added the vendor gossip item programmatically, but this DB update only adds a condition for (MenuID=4085, OptionID=0) and does not add/ensure the corresponding gossip_menu_option row exists for that option. If the option row isn’t present in DB, the vendor entry will never appear even when the condition passes. Make the update self-contained by inserting/updating the required gossip_menu_option entry for MenuID 4085 (OptionID 0) with the vendor option type, then keep this condition to gate it by quest reward.
| -- Conditions on gossip_menu text: 4979 before quest, 4980 after quest | ||
| DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` = 14 AND `SourceGroup` = 4085; |
There was a problem hiding this comment.
This delete removes all SourceTypeOrReferenceId=14 conditions for MenuID=4085, not just those related to texts 4979/4980. Narrowing the DELETE to SourceEntry IN (4979, 4980) makes the update safer and reduces the chance of accidentally removing unrelated conditions on the same menu.
| -- Friendly(4)=16, Honored(5)=32, Revered(6)=64, Exalted(7)=128 => mask 240 | ||
| DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` = 14 AND `SourceGroup` = 4781; |
There was a problem hiding this comment.
Similar to the Augustus section, this DELETE removes all gossip-menu-text conditions for MenuID=4781. Consider narrowing it to only the entries you manage here (e.g., SourceEntry IN (3673, 3677, 5834) if applicable) to avoid clobbering other conditions that may legitimately exist for the same menu.
Changes Proposed:
This PR proposes changes to:
Move gossip handling from C++ scripts to database-driven gossip (conditions + SmartAI) for 3 NPCs in EasternKingdoms:
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.
SOURCE:
The changes have been validated through:
Augustus migration based on TC work by dr-j (commit cefed89c38bc).
Parqual migration based on TC work by offl (TC issue #24993, commit 7908b00311).
Lokhtos migration is original work (TC still uses C++ for this NPC).
Tests Performed:
This PR has been:
How to Test the Changes:
Known Issues and TODO List:
🤖 Generated with Claude Code