From 4e01dd55533bbff48158bc6cf41fe7ef78dc2f47 Mon Sep 17 00:00:00 2001 From: Kelsi Date: Wed, 6 May 2026 04:14:33 -0700 Subject: [PATCH] feat(editor): NPC template gains Faction ID input with common-value tooltip The CreatureSpawn struct has a faction field that was already exported to creature_template.faction but wasn't editable. Added an InputInt with a tooltip listing the common AzerothCore FactionTemplate IDs (Stormwind, Monster, Beast, Friendly, Critter, etc.) so users can pick the right hostility/disposition without referencing the DBC manually. --- tools/editor/editor_ui.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tools/editor/editor_ui.cpp b/tools/editor/editor_ui.cpp index fa26d383..d6e0e05c 100644 --- a/tools/editor/editor_ui.cpp +++ b/tools/editor/editor_ui.cpp @@ -1906,6 +1906,15 @@ void EditorUI::renderNpcPanel(EditorApp& app) { int arm = tmpl.armor; if (ImGui::InputInt("Armor", &arm)) tmpl.armor = std::max(0, arm); + // Faction template ID (FactionTemplate.dbc). Common AzerothCore values: + // 7 = Stormwind, 35 = Friendly to all, 14 = Monster (hostile to all), + // 16 = Beast (Wild), 250 = Critter, 71 = Theramore, etc. + int fac = static_cast(tmpl.faction); + if (ImGui::InputInt("Faction", &fac)) + tmpl.faction = static_cast(std::max(0, fac)); + if (ImGui::IsItemHovered()) + ImGui::SetTooltip("FactionTemplate ID. 7=Stormwind 14=Monster 16=Beast 35=Friendly 250=Critter"); + const char* behaviors[] = {"Stationary", "Patrol", "Wander", "Scripted"}; int bIdx = static_cast(tmpl.behavior); if (ImGui::Combo("Behavior", &bIdx, behaviors, 4))