From 00717543a8d0fa9af3cba5063fa244b716086f04 Mon Sep 17 00:00:00 2001 From: Kelsi Date: Wed, 6 May 2026 04:48:30 -0700 Subject: [PATCH] feat(editor): preset selection auto-fills sensible AzerothCore faction When a user picks a creature preset, faction stays 0 (server treats this as 'use template') unless the user already typed a value. Now defaults based on the preset category: Critter -> 250 (critter, indifferent to all) hostile preset -> 14 (monster, hostile to all) friendly preset -> 35 (friendly to all) Means picking 'Wolf' from the preset list immediately produces a hostile NPC that actually attacks players in-game without further configuration. --- tools/editor/editor_ui.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tools/editor/editor_ui.cpp b/tools/editor/editor_ui.cpp index a808c2d9..eecd9c20 100644 --- a/tools/editor/editor_ui.cpp +++ b/tools/editor/editor_ui.cpp @@ -1853,6 +1853,13 @@ void EditorUI::renderNpcPanel(EditorApp& app) { tmpl.minDamage = 3 + p.defaultLevel * 2; tmpl.maxDamage = 5 + p.defaultLevel * 3; tmpl.armor = p.defaultLevel * 10; + // Sensible AzerothCore FactionTemplate default — only set + // if the user hasn't already typed in a custom value. + if (tmpl.faction == 0) { + if (p.category == CreatureCategory::Critter) tmpl.faction = 250; + else if (p.defaultHostile) tmpl.faction = 14; // Monster + else tmpl.faction = 35; // Friendly + } } if (ImGui::IsItemHovered()) ImGui::SetTooltip("%s", p.modelPath.c_str());