Kelsidavis-WoWee/include/pipeline/wowee_pets.hpp
Kelsi 62e793800c feat(pipeline): add WPET (Wowee Pet System) catalog
Novel open replacement for AzerothCore-style pet_template +
pet_levelstats SQL + the pet-related subsets of
CreatureFamily.dbc + SpellFamilyName.dbc. The 38th open
format added to the editor.

Defines two related kinds of player-controlled NPCs in
one catalog:
  • Pet families  — hunter pet families (Wolf / Cat / Bear /
                     Boar / Raptor / Spider / etc.) with
                     per-family ability sets, base stat
                     multipliers, and diet preferences
  • Warlock minions — Imp / Voidwalker / Succubus /
                       Felhunter / Felguard, each with
                       their own summon spell, creature
                       template, and ability list

Cross-references with previously-added formats:
  WPET.family.familyId          -> WCRT.entry.familyId
                                    (matches creature family)
  WPET.family.abilities.spellId -> WSPL.entry.spellId
  WPET.minion.summonSpellId     -> WSPL.entry.spellId
  WPET.minion.creatureId        -> WCRT.entry.creatureId
                                    (used for stat scaling)
  WPET.minion.abilities.spellId -> WSPL.entry.spellId

The starter preset's familyIds (1=Wolf, 2=Cat) match
WCRT::FamilyId enum values, so a hunter taming a wolf via
WCRT links straight through to WPET ability sets.

Format:
  • magic "WPET", version 1, little-endian
  • families[]: familyId / name / description / icon /
    petType / baseAttackSpeed / damageMultiplier /
    armorMultiplier / dietMask / abilities[]
  • minions[]: minionId / name / summonSpellId / creatureId /
    abilities[] (each: spellId / rank / autocastDefault)

Enums:
  • PetType (3): Cunning / Ferocity / Tenacity
                  (WotLK+ talent tree categorization)
  • DietFlags:   Meat / Fish / Bread / Cheese / Fruit / Fungus

API: WoweePetLoader::save / load / exists +
WoweePet::findFamily / findMinion + dietMaskName helper
that decodes a dietMask into a "meat+fish" string.

Three preset emitters showcase typical pet catalogs:
  • makeStarter — 2 hunter families (Wolf + Cat) with full
                   3-ability sets + 1 warlock Imp
  • makeHunter  — 8 classic hunter families covering all
                   3 petType categories with appropriate
                   diet masks
  • makeWarlock — 5 warlock minions each with summon spell
                   ID and creatureId pointing into WCRT

CLI added (5 flags, 663 documented total now):
  --gen-pets / --gen-pets-hunter / --gen-pets-warlock
  --info-wpet / --validate-wpet

Validator catches: ids=0 + duplicates, empty name, petType
out of range, baseAttackSpeed<=0 (would divide by zero in
DPS calc), dietMask=0 (pet cannot be fed for happiness),
minion missing summonSpellId / creatureId.
2026-05-09 18:27:02 -07:00

147 lines
4.9 KiB
C++

#pragma once
#include <cstdint>
#include <string>
#include <vector>
namespace wowee {
namespace pipeline {
// Wowee Open Pet System catalog (.wpet) — novel replacement
// for AzerothCore-style pet_template + pet_levelstats SQL
// + the pet-related subsets of CreatureFamily.dbc and
// SpellFamilyName.dbc. The 38th open format added to the
// editor.
//
// Defines two related kinds of player-controlled NPCs:
// • Pet families — hunter pet families (Wolf / Cat / Bear /
// Boar / Raptor / Spider / etc.) with
// per-family ability sets, base stat
// multipliers, and diet preferences
// • Warlock minions — Imp / Voidwalker / Succubus /
// Felhunter / Felguard, each with
// their own summon spell and
// ability list
//
// Cross-references with previously-added formats:
// WPET.family.familyId → WCRT.entry.familyId
// (links to creature family)
// WPET.family.abilities.spellId → WSPL.entry.spellId
// WPET.minion.summonSpellId → WSPL.entry.spellId
// WPET.minion.creatureId → WCRT.entry.creatureId
// WPET.minion.abilities.spellId → WSPL.entry.spellId
//
// Binary layout (little-endian):
// magic[4] = "WPET"
// version (uint32) = current 1
// nameLen + name (catalog label)
// familyCount (uint32)
// families (each):
// familyId (uint32)
// nameLen + name
// descLen + description
// iconLen + iconPath
// petType (uint8) / pad[3]
// baseAttackSpeed (float) / damageMultiplier (float)
// armorMultiplier (float)
// dietMask (uint32)
// abilityCount (uint8) + pad[3] +
// abilities (each: spellId(4) + learnedAtLevel(2) + rank(1) + pad)
// minionCount (uint32)
// minions (each):
// minionId (uint32)
// nameLen + name
// summonSpellId (uint32) / creatureId (uint32)
// abilityCount (uint8) + pad[3] +
// abilities (each: spellId(4) + rank(1) + autocast(1) + pad[2])
struct WoweePet {
enum PetType : uint8_t {
Cunning = 0,
Ferocity = 1,
Tenacity = 2,
};
enum DietFlags : uint32_t {
DietMeat = 0x01,
DietFish = 0x02,
DietBread = 0x04,
DietCheese = 0x08,
DietFruit = 0x10,
DietFungus = 0x20,
};
struct FamilyAbility {
uint32_t spellId = 0;
uint16_t learnedAtLevel = 1;
uint8_t rank = 1;
};
struct Family {
uint32_t familyId = 0;
std::string name;
std::string description;
std::string iconPath;
uint8_t petType = Cunning;
float baseAttackSpeed = 2.0f;
float damageMultiplier = 1.0f;
float armorMultiplier = 1.0f;
uint32_t dietMask = 0;
std::vector<FamilyAbility> abilities;
};
struct MinionAbility {
uint32_t spellId = 0;
uint8_t rank = 1;
uint8_t autocastDefault = 0; // 1 = autocast enabled by default
};
struct Minion {
uint32_t minionId = 0;
std::string name;
uint32_t summonSpellId = 0;
uint32_t creatureId = 0; // WCRT cross-ref for stats
std::vector<MinionAbility> abilities;
};
std::string name;
std::vector<Family> families;
std::vector<Minion> minions;
bool isValid() const { return !families.empty() || !minions.empty(); }
const Family* findFamily(uint32_t familyId) const;
const Minion* findMinion(uint32_t minionId) const;
static const char* petTypeName(uint8_t t);
// Decode a dietMask into a short string ("meat+fish").
static std::string dietMaskName(uint32_t mask);
};
class WoweePetLoader {
public:
static bool save(const WoweePet& cat,
const std::string& basePath);
static WoweePet load(const std::string& basePath);
static bool exists(const std::string& basePath);
// Preset emitters used by --gen-pets* variants.
//
// makeStarter — 2 hunter families (Wolf + Cat) with
// 3 abilities each + 1 warlock minion
// (Imp).
// makeHunter — full beast family set (8 classic
// families: Wolf / Cat / Bear / Boar /
// Raptor / Hyena / Spider / Bat) with
// per-type Cunning/Ferocity/Tenacity
// classification.
// makeWarlock — 5 minions (Imp / Voidwalker /
// Succubus / Felhunter / Felguard) with
// summon spell + creature template
// cross-refs.
static WoweePet makeStarter(const std::string& catalogName);
static WoweePet makeHunter(const std::string& catalogName);
static WoweePet makeWarlock(const std::string& catalogName);
};
} // namespace pipeline
} // namespace wowee