Add player death handling, race-aware faction hostility, and all-race texture support

- Death screen with "Release Spirit" button sends CMSG_REPOP_REQUEST
- Detect player death/resurrection via health updates (VALUES and CREATE)
- Faction hostility map now built per-character race instead of hardcoded Human
- CharSections.dbc texture lookup enabled for all races (was Human-only)
- Fallback texture paths use race folder names instead of hardcoded Human
- Player name in unit frame is clickable for self-targeting
This commit is contained in:
Kelsi 2026-02-06 17:27:20 -08:00
parent 462afd6bce
commit f20ef1f20d
9 changed files with 270 additions and 102 deletions

View file

@ -82,6 +82,7 @@ private:
std::string getPlayerModelPath() const;
static const char* mapIdToName(uint32_t mapId);
void loadOnlineWorldTerrain(uint32_t mapId, float x, float y, float z);
void buildFactionHostilityMap(uint8_t playerRace);
void spawnOnlineCreature(uint64_t guid, uint32_t displayId, float x, float y, float z, float orientation);
void despawnOnlineCreature(uint64_t guid);
void buildCreatureDisplayLookups();

View file

@ -314,6 +314,10 @@ public:
uint64_t getPlayerGuid() const { return playerGuid; }
void setPlayerGuid(uint64_t guid) { playerGuid = guid; }
// Player death state
bool isPlayerDead() const { return playerDead_; }
void releaseSpirit();
// ---- Phase 4: Group ----
void inviteToGroup(const std::string& playerName);
void acceptGroupInvite();
@ -693,6 +697,7 @@ private:
uint32_t localPlayerHealth_ = 0;
uint32_t localPlayerMaxHealth_ = 0;
uint32_t localPlayerLevel_ = 1;
bool playerDead_ = false;
struct NpcAggroEntry {
uint64_t guid;

View file

@ -164,6 +164,9 @@ enum class Opcode : uint16_t {
SMSG_ITEM_QUERY_SINGLE_RESPONSE = 0x058,
CMSG_AUTOEQUIP_ITEM = 0x10A,
SMSG_INVENTORY_CHANGE_FAILURE = 0x112,
// ---- Death/Respawn ----
CMSG_REPOP_REQUEST = 0x015A,
};
} // namespace game

View file

@ -1268,5 +1268,11 @@ public:
static bool parse(network::Packet& packet, ListInventoryData& data);
};
/** CMSG_REPOP_REQUEST packet builder */
class RepopRequestPacket {
public:
static network::Packet build();
};
} // namespace game
} // namespace wowee

View file

@ -140,6 +140,7 @@ private:
void renderQuestDetailsWindow(game::GameHandler& gameHandler);
void renderVendorWindow(game::GameHandler& gameHandler);
void renderTeleporterPanel();
void renderDeathScreen(game::GameHandler& gameHandler);
void renderEscapeMenu();
void renderSettingsWindow();