Skip to content

fix(DB): align creature spawns with new id column - #7

Merged
Helias merged 2 commits into
masterfrom
align-creature
Jun 21, 2026
Merged

fix(DB): align creature spawns with new id column#7
Helias merged 2 commits into
masterfrom
align-creature

Conversation

@Helias

@Helias Helias commented Jun 21, 2026

Copy link
Copy Markdown
Member

Aligns the module SQL with core PR azerothcore/azerothcore-wotlk#25197, which renamed creature.id1 to creature.id and moved the rarely used id2/id3 columns into the new creature_multispawn table.

All creature spawns in this module used 0 for id2/id3, so there is nothing to migrate into creature_multispawn. The changes are:

  • Column lists changed from (`guid`, `id1`, `id2`, `id3`, ...) to (`guid`, `id`, ...).
  • VALUES rows dropped the two 0,0 fields for id2/id3.
  • DELETE/UPDATE filters now use `id` instead of `id1`.

Mirrors the same alignment done in lightninjay/mod-tcg-vendors#8.

Summary by CodeRabbit

  • Chores
    • Updated quest and war event creature maintenance to use a consolidated creature identifier, improving consistency across related spawn and follow-up updates.
  • Bug Fixes
    • Corrected war event creature spawn entries to match the current column layout.
    • Fixed rotation values for affected war event objects to ensure proper in-world orientation.

Core PR azerothcore/azerothcore-wotlk#25197 renamed creature.id1 to id
and dropped the id2/id3 columns into the new creature_multispawn table.
All spawns in this module used 0 for id2/id3, so the column list and
VALUES rows are updated to the new schema and the DELETE/UPDATE filters
now reference id instead of id1.

References azerothcore/azerothcore-wotlk#25197
@coderabbitai

coderabbitai Bot commented Jun 21, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 5404519e-f15e-48c0-bc43-dfb4e90970ba

📥 Commits

Reviewing files that changed from the base of the PR and between 48979a6 and 7dd1b0a.

📒 Files selected for processing (2)
  • data/sql/db-world/updates/quests.sql
  • data/sql/db-world/updates/warevent.sql
🚧 Files skipped from review as they are similar to previous changes (1)
  • data/sql/db-world/updates/quests.sql

📝 Walkthrough

Walkthrough

Two SQL update scripts (quests.sql and warevent.sql) migrate the creature table from the legacy id1/id2/id3 column layout to the single id column in all DELETE, INSERT, and UPDATE statements. Additionally, war event gameobject rotation quaternion values are adjusted for specific spawned objects.

Changes

creature.id Column Migration

Layer / File(s) Summary
quests.sql: creature DELETE/INSERT/UPDATE blocks
data/sql/db-world/updates/quests.sql
Rewrites creature DELETE and INSERT blocks for quest NPCs and Horde/Alliance commendation NPCs to use the id column instead of id1/id2/id3; adds game_event_creature cleanup by creature.id; fixes two UPDATE creature predicates from WHERE id1 = to WHERE id = for entries 15701 and @NPC.
warevent.sql: AQ War Event creature respawn block
data/sql/db-world/updates/warevent.sql
Switches AQ War Event creature cleanup from DELETE WHERE id1 IN (...) to DELETE WHERE id IN (...) and rewrites the INSERT INTO creature column list to use id instead of id1/id2/id3 for all boss-variant entries.

War Event gameobject Rotation Adjustments

Layer / File(s) Summary
warevent.sql: gameobject rotation updates
data/sql/db-world/updates/warevent.sql
Updates the rotation0rotation3 quaternion fields in gameobject INSERT values for GUIDs 105000–105005, replacing mostly-zero values with specific non-zero floating-point values per row.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐇 Hop hop, the columns align,
id1, id2, id3 — left behind!
One tidy id now rules each row,
And gameobjects spin in graceful flow.
The schema hops toward perfection! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix(DB): align creature spawns with new id column' accurately summarizes the main change: migrating creature spawn definitions from the old id1/id2/id3 column schema to the new single id column structure.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch align-creature

Comment @coderabbitai help to get the list of available commands and usage tips.

@Helias Helias changed the title refactor(DB): align creature spawns with new id column fix(DB): align creature spawns with new id column Jun 21, 2026
With the creature SQL now importing cleanly, the worldserver starts far
enough to surface two pre-existing data issues that the old failing
import hid:

- The module deletes core's AQ War Effort NPCs (game_event 22) by entry
  and respawns them permanently, leaving the matching game_event_creature
  rows pointing at deleted guids. Drop those references before deleting
  the creatures.
- The replacement gong gameobjects stored a zero (non-unit) rotation
  quaternion. Set the proper Z-axis quaternion derived from each
  orientation so the loader stops logging an error.
@Helias
Helias merged commit c4e7b9c into master Jun 21, 2026
2 checks passed
@Helias
Helias deleted the align-creature branch June 21, 2026 10:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant