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.
This commit is contained in:
Kelsi 2026-05-06 04:14:33 -07:00
parent da2e7a4133
commit 4e01dd5553

View file

@ -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<int>(tmpl.faction);
if (ImGui::InputInt("Faction", &fac))
tmpl.faction = static_cast<uint32_t>(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<int>(tmpl.behavior);
if (ImGui::Combo("Behavior", &bIdx, behaviors, 4))