Skip to content

refactor(Core/Scripts): move Northrend gossip handlers to database#25275

Open
Nyeriah wants to merge 1 commit intoazerothcore:masterfrom
Nyeriah:northrend-gossip-to-db
Open

refactor(Core/Scripts): move Northrend gossip handlers to database#25275
Nyeriah wants to merge 1 commit intoazerothcore:masterfrom
Nyeriah:northrend-gossip-to-db

Conversation

@Nyeriah
Copy link
Copy Markdown
Member

@Nyeriah Nyeriah commented Mar 28, 2026

Changes Proposed

Move simple gossip handlers from C++ scripts to database conditions + SmartAI for 6 Northrend NPCs:

  • Iruk (26219) — Quest-gated spell cast: shows option if quest 11961 incomplete, casts Create Totem of Issliruk on select
  • Deathstalker Razael (23998) & Dark Ranger Lyana (23778) — Quest-gated creature credit for "Reports from the Field" (quest 11221). Gossip menu chains already wired in DB (8870→8869, 8879→8878). SAI gives TalkedToCreature credit on select
  • Roxi Ramrocket (31247) — Spell-gated vendor: trainer option already in DB, adds vendor option conditioned on knowing Mechano-Hog (60866) or Mekgineer's Chopper (60867)
  • Avatar of Freya (27801) — 3-step gossip chain already fully wired in DB (9720→9721→9722). Adds quest condition on first option (quest 12621) and SAI for final spell cast (52045)

Minor behavioral note

The original C++ for Razael/Lyana checked GetReqKillOrCastCurrentCount to hide the gossip option after credit was already given. The DB condition only checks quest incomplete status, so the option remains visible until the quest is turned in. This is cosmetic only — selecting it again harmlessly re-gives credit.

How Has This Been Tested?

Requires in-game testing:

  • Iruk shows gossip option only with quest 11961 incomplete, creates totem on select
  • Razael gives quest credit for objective 1 of quest 11221, shows response text
  • Lyana gives quest credit for objective 2 of quest 11221, shows response text
  • Roxi Ramrocket shows trainer option always, vendor option only if player knows Mechano-Hog or Mekgineer's Chopper
  • Avatar of Freya shows 3-step gossip chain only with quest 12621 incomplete, casts spell on final step

Issues Addressed

Continuation of #25207 and #25274 — moving hardcoded gossip handlers to database handling.

AI Usage Disclosure

Generated with Claude Code (Claude Opus 4.6)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings March 28, 2026 01:07
@github-actions github-actions bot added DB related to the SQL database Script Refers to C++ Scripts for the Core file-cpp Used to trigger the matrix build labels Mar 28, 2026
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

Refactors several Northrend NPC gossip interactions by removing hardcoded C++ gossip handlers and re-implementing the behavior using database-driven gossip conditions and SmartAI scripts.

Changes:

  • Removed C++ gossip scripts/registrations for Iruk, Deathstalker Razael & Dark Ranger Lyana, Roxi Ramrocket, and Avatar of Freya.
  • Added a world DB update to gate gossip options via conditions and to trigger casts/credits via smart_scripts.
  • Updated creature_template rows to drop ScriptName usage and enable SmartAI where needed.

Reviewed changes

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

Show a summary per file
File Description
src/server/scripts/Northrend/zone_storm_peaks.cpp Removes Roxi Ramrocket C++ gossip script and registration.
src/server/scripts/Northrend/zone_sholazar_basin.cpp Removes Avatar of Freya C++ gossip script and registration.
src/server/scripts/Northrend/zone_howling_fjord.cpp Removes Razael/Lyana C++ gossip script and registration.
src/server/scripts/Northrend/zone_borean_tundra.cpp Removes Iruk C++ gossip script and registration.
data/sql/updates/pending_db_world/rev_1774590000_gossip_northrend.sql Adds DB conditions + SmartAI actions to replace removed gossip logic.

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

Comment on lines +41 to +45
-- SAI for Razael (23998): on gossip select (menu 8870, option 0) -> quest credit 23998
DELETE FROM `smart_scripts` WHERE `entryorguid`=23998 AND `source_type`=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
(23998, 0, 0, 0, 62, 0, 100, 512, 8870, 0, 0, 0, 0, 0, 33, 23998, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 'Razael - On Gossip Select - Quest Credit 23998');

Copy link

Copilot AI Mar 28, 2026

Choose a reason for hiding this comment

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

SMART_ACTION_CALL_KILLEDMONSTER (33) ultimately calls Player::RewardPlayerAndGroupAtEvent(...), which can grant objective credit to nearby group members as well (and also runs the kill-credit achievement updates). The removed C++ used Player::TalkedToCreature(...), which is per-player and does not share to the group. If you need to preserve the original behavior, this likely needs a small C++ handler (or a new SmartAI action/core hook that calls TalkedToCreature without group sharing) rather than CALL_KILLEDMONSTER.

Copilot uses AI. Check for mistakes.
Comment on lines +49 to +53
-- SAI for Lyana (23778): append gossip handler to existing SAI (id 0 = OOC say already exists)
DELETE FROM `smart_scripts` WHERE `entryorguid`=23778 AND `source_type`=0 AND `id`=1;
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
(23778, 0, 1, 0, 62, 0, 100, 512, 8879, 0, 0, 0, 0, 0, 33, 23778, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 'Lyana - On Gossip Select - Quest Credit 23778');

Copy link

Copilot AI Mar 28, 2026

Choose a reason for hiding this comment

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

Same as Razael: SMART_ACTION_CALL_KILLEDMONSTER (33) uses RewardPlayerAndGroupAtEvent, so this can award credit to nearby group members (and update kill-achievement criteria) unlike the previous TalkedToCreature call. If the intention is to keep the gossip credit strictly per-player, consider keeping a minimal C++ gossip select handler (or adding a SmartAI/core support action) instead of using action 33 here.

Copilot uses AI. Check for mistakes.
Comment on lines +68 to +72
-- Condition on vendor option: HasSpell 60866 (Mechano-Hog) OR HasSpell 60867 (Mekgineer's Chopper)
DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=10210 AND `SourceEntry`=1;
INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
(15, 10210, 1, 0, 0, 16, 0, 60866, 0, 0, 0, 0, 0, '', 'Roxi Ramrocket - Show vendor option if player has Mechano-Hog'),
(15, 10210, 1, 0, 1, 16, 0, 60867, 0, 0, 0, 0, 0, '', 'Roxi Ramrocket - Show vendor option if player has Mekgineer''s Chopper');
Copy link

Copilot AI Mar 28, 2026

Choose a reason for hiding this comment

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

These conditions use ConditionTypeOrReference=16, which in AzerothCore is CONDITION_RACE (not "player has spell"). To gate the vendor option on knowing mount spells 60866/60867, use CONDITION_SPELL (25) with ConditionValue1 set to the spell ID (your ElseGroup setup for OR logic can stay the same).

Copilot uses AI. Check for mistakes.
Comment on lines +84 to +88
-- Condition on menu 9720 option 0: quest 12621 incomplete
DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=9720 AND `SourceEntry`=0;
INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
(15, 9720, 0, 0, 0, 9, 0, 12621, 0, 0, 0, 0, 0, '', 'Avatar of Freya - Show gossip option if quest 12621 is taken');

Copy link

Copilot AI Mar 28, 2026

Choose a reason for hiding this comment

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

Like the Iruk condition above, this uses ConditionTypeOrReference=9 (CONDITION_QUESTTAKEN), which stays true even after quest objectives are completed. The removed C++ only offered the first gossip option when quest 12621 was QUEST_STATUS_INCOMPLETE. To match that behavior, use CONDITION_QUESTSTATE (47) with mask 8 (in progress) or add a negative CONDITION_QUEST_COMPLETE (28).

Copilot uses AI. Check for mistakes.
Comment on lines +10 to +13
-- Condition on gossip_menu_option: show option if quest 11961 is taken
DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=9280 AND `SourceEntry`=0;
INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
(15, 9280, 0, 0, 0, 9, 0, 11961, 0, 0, 0, 0, 0, '', 'Iruk - Show option if quest 11961 is taken');
Copy link

Copilot AI Mar 28, 2026

Choose a reason for hiding this comment

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

The condition used here is ConditionTypeOrReference=9 (CONDITION_QUESTTAKEN), which is true as long as the quest is in the log (including when objectives are completed but not yet turned in). The removed C++ checked QUEST_STATUS_INCOMPLETE, so the option should disappear once the quest is complete. To match the previous behavior, use CONDITION_QUESTSTATE (47) with state mask 8 (in progress), or combine CONDITION_QUESTTAKEN with a negative CONDITION_QUEST_COMPLETE (28).

Copilot uses AI. Check for mistakes.
Comment on lines +31 to +39
-- Condition on menu 8870 option 0: quest 11221 incomplete
DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=8870 AND `SourceEntry`=0;
INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
(15, 8870, 0, 0, 0, 9, 0, 11221, 0, 0, 0, 0, 0, '', 'Razael - Show gossip option if quest 11221 is taken');

-- Condition on menu 8879 option 0: quest 11221 incomplete
DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=8879 AND `SourceEntry`=0;
INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
(15, 8879, 0, 0, 0, 9, 0, 11221, 0, 0, 0, 0, 0, '', 'Lyana - Show gossip option if quest 11221 is taken');
Copy link

Copilot AI Mar 28, 2026

Choose a reason for hiding this comment

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

These new conditions are documented as "quest 11221 incomplete", but they use ConditionTypeOrReference=9 (CONDITION_QUESTTAKEN). That will also allow the gossip options after the quest is completed (but before turn-in). If the intent is truly "incomplete" like the removed C++ logic, switch to CONDITION_QUESTSTATE (47) with state mask 8 (in progress) or add a negative CONDITION_QUEST_COMPLETE (28).

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

DB related to the SQL database file-cpp Used to trigger the matrix build Script Refers to C++ Scripts for the Core

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants